kallol
September 21, 2010, 6:12pm
1
We know that ‘malloc’ allocates a memory block & does not initialize the pointers.
Does ‘cudaMalloc’ initialize the memory block (pointers) along with allocating it?
Because in one of the problems in image rotation,
while executing the CUDA code in GPU (using cudaMalloc), copying the pixel values from the original image(a) to final rotated image(b) , the unused pixel locations that have not been fed with pixel values(in b) show some color in the final rotated image (that means there is some value getting fed, which should not have been the case).
On the contrary, in C code(using malloc), the unused pixel locations show black color (which should have been containing some garbage value).
Please clarify the confusion.
kallol
September 22, 2010, 5:19pm
4
Then Sir, do I need to launch another kernel to initialize the memory block?
This will near about double the current processing time.
Is there any other way out?
kallol
September 22, 2010, 5:19pm
5
Then Sir, do I need to launch another kernel to initialize the memory block?
This will near about double the current processing time.
Is there any other way out?
Then Sir, do I need to launch another kernel to initialize the memory block?
This will near about double the current processing time.
Is there any other way out?
cudaMemset if you’re OK filling it with a particular byte.
Then Sir, do I need to launch another kernel to initialize the memory block?
This will near about double the current processing time.
Is there any other way out?
cudaMemset if you’re OK filling it with a particular byte.
kallol
September 22, 2010, 5:37pm
8
Sir, I’ll try this on GPU and comment back.
Thanks.
kallol
September 22, 2010, 5:37pm
9
Sir, I’ll try this on GPU and comment back.
Thanks.
YDD
September 22, 2010, 11:52pm
10
Which will, of course, launch another kernel ;)
YDD
September 22, 2010, 11:52pm
11
Which will, of course, launch another kernel ;)
kallol
September 23, 2010, 9:34am
12
CudaMemset() did the trick.
But Sir, does cudaMemset launch another kernel?
Because there has been no difference in the previous and the new timings.
kallol
September 23, 2010, 9:34am
13
CudaMemset() did the trick.
But Sir, does cudaMemset launch another kernel?
Because there has been no difference in the previous and the new timings.
avidday
September 23, 2010, 9:37am
14
CudaMemset() did the trick.
But Sir, does cudaMemset launch another kernel?
Because there has been no difference in the previous and the new timings.
It does launch a kernel, and your results only suggest that you aren’t measuring the execution times correctly in the first place.
avidday
September 23, 2010, 9:37am
15
CudaMemset() did the trick.
But Sir, does cudaMemset launch another kernel?
Because there has been no difference in the previous and the new timings.
It does launch a kernel, and your results only suggest that you aren’t measuring the execution times correctly in the first place.
kallol
September 23, 2010, 10:01am
16
Sir, should we measure the timing of the kernel only?
or also the memory copy operations (along with cudaMemset)?
Because what I am doing is that I am only measuring the timing of the kernel.
kallol
September 23, 2010, 10:01am
17
Sir, should we measure the timing of the kernel only?
or also the memory copy operations (along with cudaMemset)?
Because what I am doing is that I am only measuring the timing of the kernel.
avidday
September 23, 2010, 10:21am
18
I suspect you are only measuring the kernel launch time, not the kernel execution time.
avidday
September 23, 2010, 10:21am
19
I suspect you are only measuring the kernel launch time, not the kernel execution time.
kallol
September 27, 2010, 1:47pm
20
No sir,
its the execution time of the kernel.