diff options
Diffstat (limited to 'tests/test_ray_intersection.py')
-rw-r--r-- | tests/test_ray_intersection.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/test_ray_intersection.py b/tests/test_ray_intersection.py deleted file mode 100644 index 7d0c53c..0000000 --- a/tests/test_ray_intersection.py +++ /dev/null @@ -1,27 +0,0 @@ -import unittest -import chroma -import numpy as np -import os -from pycuda import gpuarray as ga - -class TestRayIntersection(unittest.TestCase): - def setUp(self): - self.context = chroma.gpu.create_cuda_context() - self.module = chroma.gpu.get_cu_module('mesh.h') - self.gpu_funcs = chroma.gpu.GPUFuncs(self.module) - self.box = chroma.gpu.GPUGeometry(chroma.build(chroma.make.cube())) - - pos, dir = chroma.project.from_film() - self.pos_gpu = ga.to_gpu(chroma.gpu.to_float3(pos)) - self.dir_gpu = ga.to_gpu(chroma.gpu.to_float3(dir)) - - testdir = os.path.dirname(os.path.abspath(chroma.tests.__file__)) - self.dx_standard = np.load(os.path.join(testdir, - 'data/ray_intersection.npz')) - def test_intersection_distance(self): - dx = ga.zeros(self.pos_gpu.size, dtype=np.float32) - self.gpu_funcs.distance_to_mesh(np.int32(self.pos_gpu.size), self.pos_gpu, self.dir_gpu, self.box.gpudata, dx, block=(64,1,1), grid=(self.pos_gpu.size//64+1,1)) - self.assertTrue((dx.get() == self.dx_standard).all()) - - def tearDown(self): - self.context.pop() |