Segmentation Fault


I want to why do we get “segmentation fault” error while running certain CUDA programs in emulation mode even if it is compiled successfully?


You are accessing a memory location which is not yours. Just like in standard C\C++.

Alas, if only CUDA were more like SML, where a program that type checked successfully is probably correct…

Thanks for your reply. Well how do I know which memory location is mine, and by the way how do I make sure that I do not access the memory location which is not mine?

This might be a mildly impertinent question, so forgive my brashness in advance, but have you actually ever done any C or C++ programming or debugging before?

If not, this would seem to be a pretty good moment to visit the library or search engine of your choice and procure some reading material on the subject. Until you have a reasonable grasp of the fundamentals of pointers and memory management in the C/C++ programming paradigms, I doubt you are going to make much headway programming with CUDA.

Thanks for your reply. You are right. I must review my C concept. Thanks for your help anyway. :)