나는 벡터에서 원시 포인터로가는 방법을 이해하지만, 뒤로가는 방법은 비트를 건너 뛰고있다.thrust :: device_vector에서 원시 포인터로 및 다시 포인터로?
// our host vector
thrust::host_vector<dbl2> hVec;
// pretend we put data in it here
// get a device_vector
thrust::device_vector<dbl2> dVec = hVec;
// get the device ptr
thrust::device_ptr devPtr = &d_vec[0];
// now how do i get back to device_vector?
thrust::device_vector<dbl2> dVec2 = devPtr; // gives error
thrust::device_vector<dbl2> dVec2(devPtr); // gives error
예를 들어 설명해 줄 수 있습니까?
대답는? – madmaze
dbl2 * ptrDVec = thrust :: raw_pointer_cast (& d_vec [0]); 여기에서 device_vector로 돌아갈 방법이 있습니까? – madmaze
"돌아오다"는 것은 무엇을 의미합니까? 이미 장치 포인터가 아닙니까? 정확히 무엇이 필요합니까? –