2016-10-03 59 views

回答

0

答案是否定的,如2016年11月26日,Cudafy.NET不支持volatile關鍵字。但是,您可以將Cudafy.NET放到允許某些情況下。

例:

//declare a dummy in global scope 
public static int[] volatileArray = new int[256]; 
[Cudafy] 
private static void doStuffOnGPU(GThread thread, int[] output) 
{ 
    //use the GThread.InsertCode() function to declare in CUDA 
    GThread.InsertCode("__shared__ volatile int volatileArray[256];"); 
    //do a whole bunch of stuff 
} 

這段代碼時將使用的測試順序運行全局聲明,並且將使用GPU上的揮發性聲明。

相關問題