PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Performance between 1D vs. 3D data

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Fri Dec 09, 2011 3:04 pm    Post subject: Performance between 1D vs. 3D data Reply with quote

Hi,
Has any one ever tested the performance when running GPU application between using logical 3D data array Arr(A,B,C) vs. mapping the data to 1D array Arr(A*B*C).
I'm curious to see if the performance is that much difference that we should consider using 1D array, as using 3D is more intuitive from programming side.

Thanks,
Tuan
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Sat Dec 10, 2011 12:33 am    Post subject: Reply with quote

My main concern is that in 1D representation we can pad data in the front easily to make sure data alignment, i.e. N elements with padding of size 'padding'

Code:
Allocate (A_dev(N+padding))

then we pass A_dev(padding:) to the kernel.

However, in 3D representation, we cannot do such padding, right?


Thanks,
Tuan
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5952
Location: The Portland Group Inc.

PostPosted: Wed Dec 14, 2011 10:57 am    Post subject: Reply with quote

Hi Tuan,

While I haven't studied it specifically, since the compiler will transform a 3D array to a 1D array on the device, my assumption is that there would be little difference in performance.

You are correct in that padding can make a small difference in kernel performance due to caches. However, in my experience this is very minor. Of course, your code may benefit from it so you should experiment.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group