Ik heb nu zelf een probleem met mn CUDA applicatie;
Misschien dat jullie me even kunnen helpen.
Ik wil 3 pointers welke vanaf mn GPU te benaderen zijn, globaal opslaan; zodat ze de volgende frame weer kan gebruiken
Hetvolgende is het probleem, ik wil gaan deinterlacen op mn GPU. Hiervoor heb ik 3 frames nodig.
En nu wil ik de drie pointers van deze frames ergens globaal opslaan, zodat wanneer mijn GPU weer in een in die lus komt, hij de laatste twee van de vorige keer kan gebruiken, zonder dat je die weer opnieuw hoeft te memcpy-en.
Ik heb in de CUDA Programming Guide 2.0 hetvolgende gevonden:
Weet iemand hoe ik dit kan doen / oplossen?
Edit:
even een snippet-code erbij
Vergeten titel toe te voegen;
Moet zijn: [CUDA] Globaal geheugen GPU
Misschien dat jullie me even kunnen helpen.
Ik wil 3 pointers welke vanaf mn GPU te benaderen zijn, globaal opslaan; zodat ze de volgende frame weer kan gebruiken
Hetvolgende is het probleem, ik wil gaan deinterlacen op mn GPU. Hiervoor heb ik 3 frames nodig.
En nu wil ik de drie pointers van deze frames ergens globaal opslaan, zodat wanneer mijn GPU weer in een in die lus komt, hij de laatste twee van de vorige keer kan gebruiken, zonder dat je die weer opnieuw hoeft te memcpy-en.
Ik heb in de CUDA Programming Guide 2.0 hetvolgende gevonden:
[b]4.2.2.1 __device__[/b] The __device__ qualifier declares a variable that resides on the device. At most one of the other type qualifiers defined in the next three sections may be used together with __device__ to further specify which memory space the variable belongs to. If none of them is present, the variable: Resides in global memory space, Has the lifetime of an application, Is accessible from all the threads within the grid and from the host through the runtime library.
Weet iemand hoe ik dit kan doen / oplossen?
Edit:
even een snippet-code erbij
C:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| //Defines staan globaal! __device__ int *d_pBuf_Y; __device__ int *d_cBuf_Y; __device__ int *d_nBuf_Y; __device__ int *d_oBuf_Y; main() { cutilSafeCall(cudaMalloc((void**) &d_pBuf_Y, d_BufSize)); cutilSafeCall(cudaMalloc((void**) &d_cBuf_Y, d_BufSize)); cutilSafeCall(cudaMalloc((void**) &d_nBuf_Y, d_BufSize)); cutilSafeCall(cudaMalloc((void**) &d_oBuf_Y, d_BufSize)); ... while(1) { cutilSafeCall(cudaMemcpy(d_pBuf_Y, currentFrame, d_BufSize, cudaMemcpyHostToDevice)); deinterlaceFrames<<< dimGrid, dimBlock >>>( d_pBuf_Y, d_oBuf_Y, startIndex); cutilSafeCall(cudaMemcpy(oBuf_Y, d_oBuf_Y, d_BufSize, cudaMemcpyDeviceToHost)); } } __global__ void deinterlaceFrames(int *d_pBuf_Y, int *d_oBuf_Y, int startIndex) { int *d_tBuf_Y = d_pBuf_Y; d_pBuf_Y = d_cBuf_Y; d_cBuf_Y = d_nBuf_Y; d_nBuf_Y = d_tBuf_Y; d_oBuf_Y = d_cBuf_Y; ... } |
Vergeten titel toe te voegen;
Moet zijn: [CUDA] Globaal geheugen GPU
[ Voor 3% gewijzigd door Matis op 26-02-2009 15:49 ]
If money talks then I'm a mime
If time is money then I'm out of time