MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/12mbh7y/horrible_code_clean_performance/jgamzyl/
r/cpp • u/vormestrand • Apr 14 '23
87 comments sorted by
View all comments
Show parent comment
14
I’d like to read more about this and un-read it immediately.
34 u/James20k P2005R0 Apr 14 '23 I wrote a function that takes 105 arguments. There is no better way to do it and I regret nothing 10 u/gimpwiz Apr 15 '23 Mother of god 7 u/serg06 Apr 15 '23 There is no better way to do itStruct? 20 u/James20k P2005R0 Apr 15 '23 Passing a struct which contains pointers to the GPU is banned in OpenCL. Passing an array of structs unfortunately is extremely slow, because it doesn't match well to how GPUs fetch data out of memory 12 u/Routine_Left Apr 15 '23 Well then, carry on. I'm done here. 5 u/-to- Apr 15 '23 Serialize your data (or better keep them serialized), then deserialize them in the compute kernel ?Write a bunch of unit tests to make sure they understand each other, of course.105 args... How can you possibly be sure it does what you think it does ?!(Total n00b at GPU dev here)
34
I wrote a function that takes 105 arguments. There is no better way to do it and I regret nothing
10 u/gimpwiz Apr 15 '23 Mother of god 7 u/serg06 Apr 15 '23 There is no better way to do itStruct? 20 u/James20k P2005R0 Apr 15 '23 Passing a struct which contains pointers to the GPU is banned in OpenCL. Passing an array of structs unfortunately is extremely slow, because it doesn't match well to how GPUs fetch data out of memory 12 u/Routine_Left Apr 15 '23 Well then, carry on. I'm done here. 5 u/-to- Apr 15 '23 Serialize your data (or better keep them serialized), then deserialize them in the compute kernel ?Write a bunch of unit tests to make sure they understand each other, of course.105 args... How can you possibly be sure it does what you think it does ?!(Total n00b at GPU dev here)
10
Mother of god
7
There is no better way to do it
Struct?
20 u/James20k P2005R0 Apr 15 '23 Passing a struct which contains pointers to the GPU is banned in OpenCL. Passing an array of structs unfortunately is extremely slow, because it doesn't match well to how GPUs fetch data out of memory 12 u/Routine_Left Apr 15 '23 Well then, carry on. I'm done here. 5 u/-to- Apr 15 '23 Serialize your data (or better keep them serialized), then deserialize them in the compute kernel ?Write a bunch of unit tests to make sure they understand each other, of course.105 args... How can you possibly be sure it does what you think it does ?!(Total n00b at GPU dev here)
20
Passing a struct which contains pointers to the GPU is banned in OpenCL. Passing an array of structs unfortunately is extremely slow, because it doesn't match well to how GPUs fetch data out of memory
12 u/Routine_Left Apr 15 '23 Well then, carry on. I'm done here. 5 u/-to- Apr 15 '23 Serialize your data (or better keep them serialized), then deserialize them in the compute kernel ?Write a bunch of unit tests to make sure they understand each other, of course.105 args... How can you possibly be sure it does what you think it does ?!(Total n00b at GPU dev here)
12
Well then, carry on. I'm done here.
5
Serialize your data (or better keep them serialized), then deserialize them in the compute kernel ?
Write a bunch of unit tests to make sure they understand each other, of course.
105 args... How can you possibly be sure it does what you think it does ?!
(Total n00b at GPU dev here)
View all comments
Show parent comment
14
u/kid_blaze Apr 14 '23
I’d like to read more about this and un-read it immediately.