I am trying to convert an integer (32-bit) to a const char* from within __global__ kernel() function in CUDA and I cannot find a way to do it.
I cannot use string functions since it complains that I am trying to call a host function.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do a search online for itoa() implementations and make a device function with one that covers what you need.
You may want to rethink your design though. It could be that you’re on the wrong track if you need to format strings on the GPU.