Skip to content

Commit

Permalink
Testing passed after install ...
Browse files Browse the repository at this point in the history
  • Loading branch information
zamorays committed Oct 21, 2015
1 parent 4b1991e commit 7883a2b
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions test/test_driver.py
Expand Up @@ -314,18 +314,19 @@ def test_multichannel_linear_texture(self):
def test_2d_fp_textures(self):
orden = "C"
npoints = 32
for prec in [np.float32,np.float64,np.complex64,np.complex128]:
for prec in [np.int16,np.float32,np.float64,np.complex64,np.complex128]:
prec_str = dtype_to_ctype(prec)
if prec == np.complex64: fpName_str = 'cfloat'
elif prec == np.complex128: fpName_str = 'cdouble'
if prec == np.complex64: fpName_str = 'fp_tex_cfloat'
elif prec == np.complex128: fpName_str = 'fp_tex_cdouble'
elif prec == np.float64: fpName_str = 'fp_tex_double'
else: fpName_str = prec_str
A_cpu = np.zeros([npoints,npoints],order=orden,dtype=prec)
A_cpu[:] = np.random.rand(npoints,npoints)[:]
A_gpu = gpuarray.zeros(A_cpu.shape,dtype=prec,order=orden)

myKern = '''
#include <pycuda-helpers.hpp>
texture<fp_tex_fpName, 2, cudaReadModeElementType> mtx_tex;
texture<fpName, 2, cudaReadModeElementType> mtx_tex;
__global__ void copy_texture(cuPres *dest)
{
Expand Down Expand Up @@ -356,18 +357,19 @@ def test_2d_fp_textures(self):
def test_3d_fp_textures(self):
orden = "C"
npoints = 32
for prec in [np.float32,np.float64,np.complex64,np.complex128]:
for prec in [np.int16,np.float32,np.float64,np.complex64,np.complex128]:
prec_str = dtype_to_ctype(prec)
if prec == np.complex64: fpName_str = 'cfloat'
elif prec == np.complex128: fpName_str = 'cdouble'
if prec == np.complex64: fpName_str = 'fp_tex_cfloat'
elif prec == np.complex128: fpName_str = 'fp_tex_cdouble'
elif prec == np.float64: fpName_str = 'fp_tex_double'
else: fpName_str = prec_str
A_cpu = np.zeros([npoints,npoints,npoints],order=orden,dtype=prec)
A_cpu[:] = np.random.rand(npoints,npoints,npoints)[:]
A_gpu = gpuarray.zeros(A_cpu.shape,dtype=prec,order=orden)

myKern = '''
#include <pycuda-helpers.hpp>
texture<fp_tex_fpName, 3, cudaReadModeElementType> mtx_tex;
texture<fpName, 3, cudaReadModeElementType> mtx_tex;
__global__ void copy_texture(cuPres *dest)
{
Expand Down Expand Up @@ -398,10 +400,11 @@ def test_3d_fp_textures(self):
def test_3d_fp_surfaces(self):
orden = "C"
npoints = 32
for prec in [np.float32,np.float64,np.complex64,np.complex128]:
for prec in [np.int16,np.float32,np.float64,np.complex64,np.complex128]:
prec_str = dtype_to_ctype(prec)
if prec == np.complex64: fpName_str = 'cfloat'
elif prec == np.complex128: fpName_str = 'cdouble'
if prec == np.complex64: fpName_str = 'fp_tex_cfloat'
elif prec == np.complex128: fpName_str = 'fp_tex_cdouble'
elif prec == np.float64: fpName_str = 'fp_tex_double'
else: fpName_str = prec_str
A_cpu = np.zeros([npoints,npoints,npoints],order=orden,dtype=prec)
A_cpu[:] = np.random.rand(npoints,npoints,npoints)[:]
Expand Down Expand Up @@ -452,10 +455,11 @@ def test_3d_fp_surfaces(self):
def test_2d_fp_surfaces(self):
orden = "C"
npoints = 32
for prec in [np.float32,np.float64,np.complex64,np.complex128]:
for prec in [np.int16,np.float32,np.float64,np.complex64,np.complex128]:
prec_str = dtype_to_ctype(prec)
if prec == np.complex64: fpName_str = 'cfloat'
elif prec == np.complex128: fpName_str = 'cdouble'
if prec == np.complex64: fpName_str = 'fp_tex_cfloat'
elif prec == np.complex128: fpName_str = 'fp_tex_cdouble'
elif prec == np.float64: fpName_str = 'fp_tex_double'
else: fpName_str = prec_str
A_cpu = np.zeros([npoints,npoints],order=orden,dtype=prec)
A_cpu[:] = np.random.rand(npoints,npoints)[:]
Expand Down

0 comments on commit 7883a2b

Please sign in to comment.