提交 409552f5 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Follow the rename of libgpuarray.

上级 a1796d2d
...@@ -184,7 +184,7 @@ Here is the state of that vision as of December 3th, 2013 (after Theano release ...@@ -184,7 +184,7 @@ Here is the state of that vision as of December 3th, 2013 (after Theano release
* We have a CUDA backend for tensors of type `float32` only. * We have a CUDA backend for tensors of type `float32` only.
* Efforts have begun towards a generic GPU ndarray (GPU tensor) (started in the * Efforts have begun towards a generic GPU ndarray (GPU tensor) (started in the
`compyte <https://github.com/inducer/compyte/wiki>`_ project) `libgpuarray <https://github.com/abergeron/libgpuarray>`_ project)
* Move GPU backend outside of Theano (on top of PyCUDA/PyOpenCL) * Move GPU backend outside of Theano (on top of PyCUDA/PyOpenCL)
* Will provide better support for GPU on Windows and use an OpenCL backend on CPU. * Will provide better support for GPU on Windows and use an OpenCL backend on CPU.
......
...@@ -112,7 +112,7 @@ class GpuKernelBase(object): ...@@ -112,7 +112,7 @@ class GpuKernelBase(object):
return '|'.join(flags) return '|'.join(flags)
def c_headers(self): def c_headers(self):
return ['compyte/types.h'] return ['gpuarray/types.h']
def c_support_code_apply(self, node, name): def c_support_code_apply(self, node, name):
kcode = self.c_kernel_code(node) kcode = self.c_kernel_code(node)
...@@ -326,8 +326,8 @@ class GpuFromCuda(Op): ...@@ -326,8 +326,8 @@ class GpuFromCuda(Op):
return xshp return xshp
def c_headers(self): def c_headers(self):
return ['<cuda_ndarray.cuh>', '<compyte/extension.h>', return ['<cuda_ndarray.cuh>', '<gpuarray/extension.h>',
'<compyte/types.h>', '<cuda.h>'] '<gpuarray/types.h>', '<cuda.h>']
def c_header_dirs(self): def c_header_dirs(self):
import cuda_ndarray import cuda_ndarray
...@@ -355,8 +355,8 @@ class GpuFromCuda(Op): ...@@ -355,8 +355,8 @@ class GpuFromCuda(Op):
""" """
def c_init_code(self): def c_init_code(self):
return ['cuda_get_ctx = (CUcontext (*)(void *))compyte_get_extension("cuda_get_ctx");', return ['cuda_get_ctx = (CUcontext (*)(void *))gpuarray_get_extension("cuda_get_ctx");',
'cuda_make_buf = (gpudata *(*)(void *, CUdeviceptr, size_t))compyte_get_extension("cuda_make_buf");'] 'cuda_make_buf = (gpudata *(*)(void *, CUdeviceptr, size_t))gpuarray_get_extension("cuda_make_buf");']
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
return """ return """
...@@ -462,7 +462,7 @@ class CudaFromGpu(Op): ...@@ -462,7 +462,7 @@ class CudaFromGpu(Op):
return shp return shp
def c_headers(self): def c_headers(self):
return ['<cuda_ndarray.cuh>', '<compyte/extension.h>', '<cuda.h>'] return ['<cuda_ndarray.cuh>', '<gpuarray/extension.h>', '<cuda.h>']
def c_header_dirs(self): def c_header_dirs(self):
import cuda_ndarray import cuda_ndarray
...@@ -490,8 +490,8 @@ class CudaFromGpu(Op): ...@@ -490,8 +490,8 @@ class CudaFromGpu(Op):
""" """
def c_init_code(self): def c_init_code(self):
return ['cuda_get_ctx = (CUcontext (*)(void *ctx))compyte_get_extension("cuda_get_ctx");', return ['cuda_get_ctx = (CUcontext (*)(void *ctx))gpuarray_get_extension("cuda_get_ctx");',
'cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))compyte_get_extension("cuda_get_ptr");'] 'cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");']
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
return """ return """
...@@ -806,7 +806,7 @@ KERNEL void k(GLOBAL_MEM %(ctype)s *a, ga_size n, ga_size m) { ...@@ -806,7 +806,7 @@ KERNEL void k(GLOBAL_MEM %(ctype)s *a, ga_size n, ga_size m) {
err = GpuKernel_call(&%(kname)s, 0, 1, 256, args); err = GpuKernel_call(&%(kname)s, 0, 1, 256, args);
if (err != GA_NO_ERROR) { if (err != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, PyErr_Format(PyExc_RuntimeError,
"compyte error: kEye: %%s. n%%lu, m=%%lu.", "gpuarray error: kEye: %%s. n%%lu, m=%%lu.",
GpuKernel_error(&%(kname)s, err), GpuKernel_error(&%(kname)s, err),
(unsigned long)dims[0], (unsigned long)dims[1]); (unsigned long)dims[0], (unsigned long)dims[1]);
%(fail)s; %(fail)s;
......
...@@ -183,14 +183,14 @@ class GpuConv(gof.Op): ...@@ -183,14 +183,14 @@ class GpuConv(gof.Op):
def c_headers(self): def c_headers(self):
return ['<stdio.h>', 'cuda.h', return ['<stdio.h>', 'cuda.h',
'<compyte/extension.h>', '<numpy_compat.h>'] '<gpuarray/extension.h>', '<numpy_compat.h>']
def c_code_cache_version(self): def c_code_cache_version(self):
# raise this whenever modifying any of the support_code_files # raise this whenever modifying any of the support_code_files
return (0, 20) return (0, 20)
def c_init_code(self): def c_init_code(self):
return ['cuda_get_ptr_raw = (CUdeviceptr (*)(gpudata *g))compyte_get_extension("cuda_get_ptr");'] return ['cuda_get_ptr_raw = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");']
def c_support_code_apply(self, node, nodename): def c_support_code_apply(self, node, nodename):
# REMEMBER TO RAISE c_code_cache_version when changing any of # REMEMBER TO RAISE c_code_cache_version when changing any of
......
...@@ -177,8 +177,8 @@ class GpuElemwise(HideC, Elemwise): ...@@ -177,8 +177,8 @@ class GpuElemwise(HideC, Elemwise):
def c_headers(self): def c_headers(self):
if pygpu.get_default_context().kind == 'opencl': if pygpu.get_default_context().kind == 'opencl':
raise MethodNotDefined('cuda only') raise MethodNotDefined('cuda only')
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>', return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>'] '<gpuarray/ext_cuda.h>']
def c_compiler(self): def c_compiler(self):
if pygpu.get_default_context().kind == 'opencl': if pygpu.get_default_context().kind == 'opencl':
...@@ -678,8 +678,8 @@ class GpuCAReduceCuda(HideC, CAReduce): ...@@ -678,8 +678,8 @@ class GpuCAReduceCuda(HideC, CAReduce):
return True return True
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>', return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>'] '<gpuarray/ext_cuda.h>']
def c_compiler(self): def c_compiler(self):
return NVCC_compiler return NVCC_compiler
...@@ -2317,7 +2317,7 @@ class GpuCAReduceCuda(HideC, CAReduce): ...@@ -2317,7 +2317,7 @@ class GpuCAReduceCuda(HideC, CAReduce):
class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype): class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype):
"""CAReduce that reuse the python code from compyte. """CAReduce that reuse the python code from gpuarray.
Too slow for now as it only have a python interface. Too slow for now as it only have a python interface.
...@@ -2535,7 +2535,7 @@ class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype): ...@@ -2535,7 +2535,7 @@ class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype):
err = GpuKernel_call(&%(k_var)s, 0, %(ls)s, gs, args); err = GpuKernel_call(&%(k_var)s, 0, %(ls)s, gs, args);
if (err != GA_NO_ERROR) { if (err != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, PyErr_Format(PyExc_RuntimeError,
"compyte error: GpuCAReduceCPY: %%s.", "gpuarray error: GpuCAReduceCPY: %%s.",
GpuKernel_error(&%(k_var)s, err)); GpuKernel_error(&%(k_var)s, err));
%(fail)s %(fail)s
} }
...@@ -2544,7 +2544,7 @@ class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype): ...@@ -2544,7 +2544,7 @@ class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype):
err = GpuArray_move(&%(output)s->ga, &tmp->ga); err = GpuArray_move(&%(output)s->ga, &tmp->ga);
if (err != GA_NO_ERROR) { if (err != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, PyErr_Format(PyExc_RuntimeError,
"compyte error: GpuCAReduceCPY [cast]: %%s.", "gpuarray error: GpuCAReduceCPY [cast]: %%s.",
GpuArray_error(&tmp->ga, err)); GpuArray_error(&tmp->ga, err));
%(fail)s %(fail)s
} }
......
...@@ -48,8 +48,8 @@ class GpuImages2Neibs(Images2Neibs, Op): ...@@ -48,8 +48,8 @@ class GpuImages2Neibs(Images2Neibs, Op):
return (9,1) return (9,1)
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>', return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>'] '<gpuarray/ext_cuda.h>']
def c_compiler(self): def c_compiler(self):
return NVCC_compiler return NVCC_compiler
......
...@@ -47,7 +47,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias(Op): ...@@ -47,7 +47,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias(Op):
return Apply(self, [x, b, y_idx], [nll, sm, am]) return Apply(self, [x, b, y_idx], [nll, sm, am])
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>'] return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>']
def c_support_code_apply(self, node, nodename): def c_support_code_apply(self, node, nodename):
dtype_x = node.inputs[0].dtype dtype_x = node.inputs[0].dtype
...@@ -111,7 +111,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias(Op): ...@@ -111,7 +111,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias(Op):
""" % locals() """ % locals()
def c_init_code(self): def c_init_code(self):
return ['cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))compyte_get_extension("cuda_get_ptr");'] return ['cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");']
def c_code(self, node, nodename, inp, out, sub): def c_code(self, node, nodename, inp, out, sub):
typecode_x = pygpu.gpuarray.dtype_to_typecode(node.inputs[0].dtype) typecode_x = pygpu.gpuarray.dtype_to_typecode(node.inputs[0].dtype)
...@@ -300,7 +300,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op): ...@@ -300,7 +300,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op):
return (6,) return (6,)
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>'] return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>']
def c_compiler(self): def c_compiler(self):
return NVCC_compiler return NVCC_compiler
...@@ -440,7 +440,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op): ...@@ -440,7 +440,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op):
""" % locals() """ % locals()
def c_init_code(self): def c_init_code(self):
return ['cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))compyte_get_extension("cuda_get_ptr");'] return ['cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");']
gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx() gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx()
...@@ -469,8 +469,8 @@ class GpuSoftmax (Op): ...@@ -469,8 +469,8 @@ class GpuSoftmax (Op):
return (12,) + inline_softmax.code_version return (12,) + inline_softmax.code_version
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>', return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>'] '<gpuarray/ext_cuda.h>']
def c_compiler(self): def c_compiler(self):
return NVCC_compiler return NVCC_compiler
...@@ -663,8 +663,8 @@ class GpuSoftmaxWithBias (Op): ...@@ -663,8 +663,8 @@ class GpuSoftmaxWithBias (Op):
return (11,) + inline_softmax.code_version return (11,) + inline_softmax.code_version
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>', return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>'] '<gpuarray/ext_cuda.h>']
def c_compiler(self): def c_compiler(self):
return NVCC_compiler return NVCC_compiler
...@@ -852,4 +852,4 @@ class GpuSoftmaxWithBias (Op): ...@@ -852,4 +852,4 @@ class GpuSoftmaxWithBias (Op):
]) ])
return (ret1 + "\n" + ret2) % locals() return (ret1 + "\n" + ret2) % locals()
gpu_softmax_with_bias = GpuSoftmaxWithBias() gpu_softmax_with_bias = GpuSoftmaxWithBias()
\ No newline at end of file
...@@ -477,8 +477,8 @@ class GpuAdvancedIncSubtensor1_dev20(GpuAdvancedIncSubtensor1): ...@@ -477,8 +477,8 @@ class GpuAdvancedIncSubtensor1_dev20(GpuAdvancedIncSubtensor1):
return (2,) return (2,)
def c_headers(self): def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>', return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>'] '<gpuarray/ext_cuda.h>']
def c_compiler(self): def c_compiler(self):
return NVCC_compiler return NVCC_compiler
......
...@@ -219,7 +219,8 @@ def test_transfer_cpu_gpu(): ...@@ -219,7 +219,8 @@ def test_transfer_cpu_gpu():
def test_transfer_strided(): def test_transfer_strided():
# This is just to ensure that it works in theano # This is just to ensure that it works in theano
# compyte has a much more comprehensive suit of tests to ensure correctness # libgpuarray has a much more comprehensive suit of tests to
# ensure correctness
a = T.fmatrix('a') a = T.fmatrix('a')
g = GpuArrayType(dtype='float32', broadcastable=(False, False))('g') g = GpuArrayType(dtype='float32', broadcastable=(False, False))('g')
......
...@@ -207,15 +207,15 @@ class GpuArrayType(Type): ...@@ -207,15 +207,15 @@ class GpuArrayType(Type):
def c_headers(self): def c_headers(self):
# We need arrayobject for the PyArrayDescr struct def # We need arrayobject for the PyArrayDescr struct def
# (even if we just use a pointer to it in a function def) # (even if we just use a pointer to it in a function def)
return ['<compyte/array.h>', '<compyte/kernel.h>', '<compyte/error.h>', return ['<gpuarray/array.h>', '<gpuarray/kernel.h>', '<gpuarray/error.h>',
'<compyte/buffer_blas.h>', '<numpy/arrayobject.h>', '<gpuarray/buffer_blas.h>', '<numpy/arrayobject.h>',
'<gpuarray_api.h>'] '<gpuarray_api.h>']
def c_header_dirs(self): def c_header_dirs(self):
return [pygpu.get_include(), numpy.get_include()] return [pygpu.get_include(), numpy.get_include()]
def c_libraries(self): def c_libraries(self):
return ['compyte'] return ['gpuarray']
def c_code_cache_version(self): def c_code_cache_version(self):
ver = pygpu.gpuarray.api_version() ver = pygpu.gpuarray.api_version()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论