首先介紹一下開發環境,visual studio 2008 +
cuda wizard for visual studio
. 確保顯示卡支援cuda(geforce 8系列之後,否則只能用模擬模式)並安裝cuda ddk及cuda toolkit。
安裝完cuda wizard for visual studio之後,如果編譯執行時出現"無法找到cutil32d.dll"的錯誤,則需要將安裝的cuda的sdk的路徑加到系統環境變數中:
例如c:\program files\nvidia corporation\nvidia cuda sdk\bin\win32\
下的├─debug
├─emudebug
├─emurelease
└─release
幾個目錄都加入到系統環境變數path中,這樣才能在執行程式的時候找到相應的dll庫。
然後就可以在vs下直接編譯cuda程式了(*.cu)。以下是乙個cuda初始化的程式。
[cpp]view plain
copy
#include
#include
bool
initcuda()
inti;
for(i=0;i
} } if
(i==count)
cudasetdevice(i);
return
true
; }
void
main()
printf("cuda initialized.\n"
);
getchar();
}
執行結果如下:
獲取檔案詳細資訊
dword dwsize getfileversioninfosize strpath,null uint nsize dwsize sizeof tchar lpvoid pblock new tchar nsize memset pblock,0,nsize getfileversioninfo...
C 獲取檔案詳細資訊
public string getmediatimelen string path else catch exception ex 這裡的getdetailsof是針對mp4檔案時長的方法,如果想獲取別的資訊,需要迴圈的輸出看一下,以確定屬性的編號 提取碼 zmyx 之後會有乙個嵌入互操作型別的錯誤...
Linux 獲取網口詳細資訊
一般來說,研究 ifconfig.c 源 就可以達到目的了。但是linux已經提供了比較方便的獲取網口資訊的方式 philip catonbj cat sys class net em1 statistics rx bytes 3911191274 在 sys class net inte ce s...