目前,我正在开发一个内核,可以使用float16类型对其进行优化。但是,我找不到任何有关将float16转换为float *的文档,因为我的输出变量是float *。这是示例代码
_kernel void IncrementMatrix( __global float* Source, __global float* Target, __global float* out )
{
const int globalID = get_global_id(0);
float16 S = vload16( globalID , Source );
float16 T = vload16( globalID , Target );
S = S + T;
out[globalID*16] = (float*)S; // this is not working
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试过=(float *)S; ,但出现无效的类型转换错误。