0

GPGPU コンピューティングは初めてです。Hybridというオンライン ライブラリを見つけました。彼らが言うには

「Hybrid.Net を使用すると、.NET 開発者は、単純でよく知られているコンストラクトである Parallel.For を使用して、データおよび計算負荷の高いアプリケーションに GPU のパワーを活用できます。」

ライブラリをダウンロードし、提供されている helloworld アプリケーションを実行すると、

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hybrid.Gpu;
using Hybrid.MsilToOpenCL;
using Hybrid;
using OpenCLNet;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
                        //define vectors a, b and c
            int vectorLength = 1024;
            int[] a = new int[vectorLength];
            int[] b = new int[vectorLength];
            int[] c = new int[vectorLength];

            //initialize vectors a, b and c

            //execute vector addition on GPU
            Hybrid.Parallel.For(Execute.OnSingleGpu, 0, vectorLength, delegate(int i)
            {
                c[i] = a[i] + b[i];
            });
        }
    }
}

私は得る

   An unhandled exception of type 'System.TypeInitializationException' occurred in Hybrid.MsilToOpenCL.dll

Additional information: The type initializer for 'OpenCLNet.OpenCL' threw an exception.

ここで何が起こっているのか誰か教えてもらえますか?

(スタックオーバーフローが初めてのことを知っているだけです。)

4

1 に答える 1

0

内部例外を確認してください。必要な詳細が含まれます。

于 2013-08-27T12:38:08.527 に答える