「eosCuda(API)」の版間の差分

提供: Eospedia
移動: 案内検索
(ページの作成:「General/'''eosCuda'''はCUDAを使用するためのAPI です。 == 定数 == == 構造体 == extern int __eosCuda__; extern int __eosCudaDeviceID__; extern int...」)
 
 
行10: 行10:
  
 
== API ==
 
== API ==
 +
初期設定
 
  extern void eosCudaInit(int deviceID);
 
  extern void eosCudaInit(int deviceID);
 +
 +
プロパティをファイルfptへ出力します。
 
  extern void eosCudaPropertiesPrint(FILE* fpt, int id);
 
  extern void eosCudaPropertiesPrint(FILE* fpt, int id);
 +
下記の内容で出力します。
 +
<pre>
 +
fprintf(fpt, "GPU Device %d: \"%s\" with compute capability %d.%d\n\n", __eosCudaDeviceID__, __eosCudaDeviceProp__.name, __eosCudaDeviceProp__.major, __eosCudaDeviceProp__.minor);
 +
fprintf(fpt, "totalGlobalMem:    %d\n", __eosCudaDeviceProp__.totalGlobalMem);
 +
fprintf(fpt, "sharedMemPerBlock:  %d\n", __eosCudaDeviceProp__.sharedMemPerBlock);
 +
fprintf(fpt, "maxThreadsPerBlock: %d\n", __eosCudaDeviceProp__.maxThreadsPerBlock);
 +
</pre>
 +
<br>

2015年3月17日 (火) 04:57時点における最新版

General/eosCudaCUDAを使用するためのAPI です。

定数

構造体

extern int __eosCuda__;
extern int __eosCudaDeviceID__;
extern int __eosCudaBlockSize__;
extern int __eosCudaThreadsPerBlock__;

API

初期設定

extern void eosCudaInit(int deviceID);

プロパティをファイルfptへ出力します。

extern void eosCudaPropertiesPrint(FILE* fpt, int id);

下記の内容で出力します。

	fprintf(fpt, "GPU Device %d: \"%s\" with compute capability %d.%d\n\n", __eosCudaDeviceID__, __eosCudaDeviceProp__.name, __eosCudaDeviceProp__.major, __eosCudaDeviceProp__.minor);
	fprintf(fpt, "totalGlobalMem:     %d\n", __eosCudaDeviceProp__.totalGlobalMem);
	fprintf(fpt, "sharedMemPerBlock:  %d\n", __eosCudaDeviceProp__.sharedMemPerBlock);
	fprintf(fpt, "maxThreadsPerBlock: %d\n", __eosCudaDeviceProp__.maxThreadsPerBlock);