배열이 CUDA 장치의 메모리 __constant__
에서 초기화하고 싶습니다. 런타임까지 크기 나 값을 알지 못합니다.CUDA에서 __constant__ 메모리를 사용하는 올바른 방법은 무엇입니까?
나는 __constant__ float Points[**N**][2]
또는 그와 비슷한 것을 사용할 수 있지만이 동적을 어떻게 만들 수 있습니까? 아마도 __constant__ float* Points
의 형태일까요?
이것이 가능합니까? 그리고 아마도 더 중요한 것은 이것이 좋은 생각입니까? 이런 식으로하는 것이 더 나은 대안이 있다면 나는 그걸 듣고 싶다.
[CUDA에서 동적 메모리의 동적 할당] (http://stackoverflow.com/questions/271273/dynamic-allocation-of-constant-memory-in-cuda)의 가능한 복제본. 이 항목은 [상수 메모리 할당 및 초기화] (https://devtalk.nvidia.com/default/topic/367449/cuda-programming-and-performance/constant-memory-allocation-and-initialization/)에서도 논의되었습니다. . – JackOLantern
그게 내가 필요한 것입니다. 이 대답을하면 받아 들일 것입니다. –