String in the kernell I don't know how use the std::string type in the kernell


I’d like to make a program that manipulate std::string type variables in the kernell. But I havn’t managed to use strings in the kernell.

That simple code doesn’t work :

#include <iostream>

#include <windows.h>

#include <math.h>

#include <string.h>

#include <vector>

#include <algorithm>

#include <time.h>

#include <cutil_inline.h>

#include <cuda.h>

using namespace std;

__global__ void kernell_function()


	string lkjd;


int main()


	dim3 dimGrid(1);

	dim3 dimBlock(1);

	kernell_function<<<dimGrid, dimBlock>>>();


It gives me the following errors :

Is it possible to use strings in the kernell? If yes, how? If no, what are the solutions to bypass the problem?

Thanks ;-)

I dont want to say its impossible since i am not sure, but im afraid youre gonna have to work with char arrays and not c++ strings.


standard strings are object oriented C++. CUDA actually supports only the C subset of C++.

Thanks for your replies guys :thumbup: