Fix sample module_api_global for hip-clang
module_api_global relies on a HCC only feature which allows host code to write to device variables. This feature does not exist in CUDA or hip-clang, which causes the sample not working in CUDA or hip-clang. This patch fixes the sample by using standard features of CUDA and hip-clang. The fixed sample works in HCC, CUDA and hip-clang.
Ta zmiana jest zawarta w:
%! (template.HTML=
Yaxun Sam Liu)złożyło 2019-07-02 16:36:53 -04:00
1 rodzic
e72893a771
złożenie
60e1733afe
2 plików zmienionych
+6
-5
Żadne pliki nie pasują do Twojego wyszukiwania
@@ -25,8 +25,7 @@ THE SOFTWARE.
|
||||
#define ARRAY_SIZE (16)
|
||||
|
||||
__device__ float myDeviceGlobal;
|
||||
extern float myDeviceGlobalArray[16];
|
||||
;
|
||||
__device__ float myDeviceGlobalArray[16];
|
||||
|
||||
extern "C" __global__ void hello_world(const float* a, float* b) {
|
||||
int tx = hipThreadIdx_x;
|
||||
|
||||
Reference in new issue
Zablokuj użytkownika