Exemplo n.º 1
0
    def setUp(self):
        NNPSTestCase.setUp(self)
        cl = importorskip("pyopencl")
        from pysph.base import gpu_nnps
        ctx = cl.create_some_context(interactive=False)

        self.nps = gpu_nnps.ZOrderGPUNNPS(
            dim=3, particles=self.particles, radius_scale=2.0,
            use_double=False, ctx=ctx
        )
Exemplo n.º 2
0
 def setUp(self):
     NNPSTestCase.setUp(self)
     cl = importorskip("pyopencl")
     from pysph.base import gpu_nnps
     cfg = get_config()
     self._orig_use_double = cfg.use_double
     cfg.use_double = True
     self.nps = gpu_nnps.ZOrderGPUNNPS(
         dim=3, particles=self.particles, radius_scale=2.0,
         backend='opencl'
     )
Exemplo n.º 3
0
    def setUp(self):
        NNPSTestCase.setUp(self)
        cl = importorskip("pyopencl")
        from pysph.base import gpu_nnps
        cfg = get_config()
        self._orig_use_double = cfg.use_double
        cfg.use_double = False
        self.nps = gpu_nnps.ZOrderGPUNNPS(
            dim=3, particles=self.particles, radius_scale=2.0,
            backend='opencl'
        )
        self.nps.spatially_order_particles(0)
        self.nps.spatially_order_particles(1)

        for pa in self.particles:
            pa.gpu.pull()
Exemplo n.º 4
0
    def setUp(self):
        NNPSTestCase.setUp(self)
        cl = importorskip("pyopencl")
        from pysph.base import gpu_nnps
        ctx = cl.create_some_context(interactive=False)
        cfg = get_config()
        self._orig_use_double = cfg.use_double
        cfg.use_double = False
        self.nps = gpu_nnps.ZOrderGPUNNPS(dim=3,
                                          particles=self.particles,
                                          radius_scale=2.0,
                                          ctx=ctx)
        self.nps.spatially_order_particles(0)
        self.nps.spatially_order_particles(1)

        for pa in self.particles:
            pa.gpu.pull()