Quantcast
Channel: Community : All Content - HSA
Viewing all articles
Browse latest Browse all 40

Finalizing HSA kernels with global variable declarations

$
0
0

I have a kernel that declares but not defines a global variable that is intended to be shared between CPU and GPU, with the aim of using hsa_executable_global_variable_define() to associate global_var with an existing variable in CPU code.

 

decl prog global_u32 &global_var;

 

prog kernel &class_write_global_kernel(kernarg_u64 %f)

{

  st_global_align(4)_u32 1, [&global_var];

  ret;

};

 

This causes a segfault in hsa_ext_program_finalize(). If I include the definition of the variable in the kernel (i.e. prog global_u32 &global_var) then the kernel finalizes successfully, but that approach prevents me from using hsa_executable_global_variable_define().


Viewing all articles
Browse latest Browse all 40

Trending Articles