Exemplo n.º 1
0
def generate_sin(a):
    gid = clrt.get_global_id(0)
    n = clrt.get_global_size(0)
    r = c_float(gid) / c_float(n)

    x = r * c_float(16.0) * c_float(3.1415)

    a[gid].x = c_float(r * 2.0) - c_float(1.0)
    a[gid].y = clrt.native_sin(x)
Exemplo n.º 2
0
def generate_sin(a):
    gid = clrt.get_global_id(0)
    n = clrt.get_global_size(0)
    r = c_float(gid) / c_float(n)
    
    x = r * c_float(16.0) * c_float(3.1415)
    
    a[gid].x = c_float(r * 2.0) - c_float(1.0)
    a[gid].y = clrt.native_sin(x)
Exemplo n.º 3
0
def generate_sin(a):

    gid = clrt.get_global_id(0)
    n = clrt.get_global_size(0)

    r = cl.cl_float(gid) / cl.cl_float(n)

    # sin wave with 8 peaks
    y = r * cl.cl_float(16.0 * 3.1415)

    # x is a range from -1 to 1
    a[gid].x = r * 2.0 - 1.0

    # y is sin wave
    a[gid].y = clrt.native_sin(y)
Exemplo n.º 4
0
def generate_sin(a):
    
    gid = clrt.get_global_id(0)
    n = clrt.get_global_size(0)
    
    r = c_float(gid) / c_float(n)
    
    # sin wave with 8 peaks
    y = r * c_float(16.0 * 3.1415)
    
    # x is a range from -1 to 1
    a[gid].x = r * 2.0 - 1.0
    
    # y is sin wave
    a[gid].y = clrt.native_sin(y)
Exemplo n.º 5
0
def generate_sin(a):
    
    gid = clrt.get_global_id(0)
    n = clrt.get_global_size(0)
    
    r = c_float(gid) / c_float(n)
    
    # sin wave with 16 occilations
    x = r * c_float(16.0 * 3.1415)
    
    # x is a range from -1 to 1
    a[gid].x = r * 2.0 - 1.0
    
    # y is sin wave
    a[gid].y = clrt.native_sin(x)