2015-09-04 1 views
0
let absoluteSumModule = (new DeviceReduceModule<float32>(GPUModuleTarget.Worker(worker), fun a b -> a+b)).Create(128000) 

J'ai essayé plusieurs paramètres de maxNumItems mais pas de quoi il lance la même exception. Contrairement à la dernière fois, je n'ai aucune idée de ce que l'erreur pourrait même être, alors j'ai inclus la décharge ici.DeviceReduceModule lève une exception Overflow

Failure 
    (Description "$f0(sm52,64)", 
    Exception 
    System.OverflowException: Value was either too large or too small for a UInt16. 
    at [email protected](Object clrModuleInstance, IRModuleBuildingContext ctx, FieldInfo fieldInfo) 
    at [email protected](IRModuleBuildingContext ctx) 
    at <StartupCode$Alea-CUDA>[email protected][T](Template`1 template, FSharpOption`1 bitcodeCache, IRModuleBuildingContext ctx, Unit unitVar0) 
    at <StartupCode$Alea-CUDA>[email protected][T](Template`1 template, FSharpOption`1 bitcodeCache, IRModuleBuildingContext ctx, Unit unitVar0), 
    System.OverflowException: Value was either too large or too small for a UInt16. 
    at [email protected](Object clrModuleInstance, IRModuleBuildingContext ctx, FieldInfo fieldInfo) 
    at [email protected](IRModuleBuildingContext ctx) 
    at <StartupCode$Alea-CUDA>[email protected][T](Template`1 template, FSharpOption`1 bitcodeCache, IRModuleBuildingContext ctx, Unit unitVar0) 
    at <StartupCode$Alea-CUDA>[email protected][T](Template`1 template, FSharpOption`1 bitcodeCache, IRModuleBuildingContext ctx, Unit unitVar0)) 
System.Exception: Compiling failed. 
    at Alea.CUDA.Worker.LoadProgram[T](Template`1 template, CompileOptions options) 
    at <StartupCode$Alea-CUDA>[email protected](Unit _arg1) 
    at System.Lazy`1.CreateValue() 
    at System.Lazy`1.LazyInitValue() 
    at <StartupCode$Alea-CUDA>[email protected](Unit _arg1) 
    at System.Lazy`1.CreateValue() 
    at System.Lazy`1.LazyInitValue() 
    at Alea.CUDA.Unbound.DeviceReduceModule`1.Create(Int32 maxNumItems) 
    at <StartupCode$FSI_0002>[email protected]() in C:\Users\Marko\Documents\Visual Studio 2015\Projects\Load MNIST\Load MNIST\utils.fsx:line 28 
Stopped due to error 

Répondre

1

Eh bien, j'ai vérifié cela, il semble que ce soit un bug. Je vais devoir vérifier cela. Cela fonctionne si vous le codez dans un fichier F # normal, mais ne fonctionne pas dans F # interactif.

Dans le même temps, en fa #, nous vous encourge d'utiliser des citations pour l'opérateur, vous pouvez essayer ceci:

> let worker = Worker.Default;; 

val worker : Worker = [0|5.2|GeForce GTX 970|7] 

> let m = new DeviceReduceModule<float32>(GPUModuleTarget.Worker(worker), <@ (+) @>);; 
Binding session to 'C:\Users\Xiang\Documents\Inbox\Library3\packages\Alea.CUDA.IL.2.1.2.3274\lib\net40\Alea.CUDA.IL.dll'... 

val m : DeviceReduceModule<float32> 

> m.GPUForceLoad();; 
Binding session to 'C:\Users\Xiang\Documents\Inbox\Library3\packages\Alea.CUDA.2.1.2.3274\lib\net40\Alea.CUDA.dll'... 
val it : unit =() 
> let x = m.Create(128000);; 

val x : DeviceReduce<float32> 

> 

Ainsi, au lieu d'utiliser fun a b -> a + b vous pouvez essayer <@ fun a b -> a + b @>, ou tout simplement <@ (+) @>.

+0

Merci de votre patience pour répondre à toutes mes questions. –