swh:1:snp:a9d01202ad630f8a750d9bf34ca651272e4b534f
Raw File
Tip revision: fd2bca8beca742517794bef0efb1f5014e494586 authored by Jyh-Miin Lin on 26 September 2020, 04:17:59 UTC
change the version to 2020.1.2
Tip revision: fd2bca8
cAddScalar.py
"""
cAddScalar
=================================
KERNEL void cAddScalar(const float2 CA,   
                    GLOBAL_MEM float2 *CX)
Offload add to heterogeneous devices.
"""

from numpy import complex64
R="""
KERNEL void cAddScalar(const float2 CA,
                                    GLOBAL_MEM float2 *CX)
{ 
// (single complex) scale x by a: x = x + ca;
// CA: add factor 
// CX: input and output array (float2)
int gid = get_global_id(0);  
CX[gid].x += CA.x;
CX[gid].y += CA.y;
};
"""
scalar_arg_dtypes=[complex64, None]
back to top