提交 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
* We have a CUDA backend for tensors of type `float32` only.
* 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)
* Will provide better support for GPU on Windows and use an OpenCL backend on CPU.
......
......@@ -112,7 +112,7 @@ class GpuKernelBase(object):
return '|'.join(flags)
def c_headers(self):
return ['compyte/types.h']
return ['gpuarray/types.h']
def c_support_code_apply(self, node, name):
kcode = self.c_kernel_code(node)
......@@ -326,8 +326,8 @@ class GpuFromCuda(Op):
return xshp
def c_headers(self):
return ['<cuda_ndarray.cuh>', '<compyte/extension.h>',
'<compyte/types.h>', '<cuda.h>']
return ['<cuda_ndarray.cuh>', '<gpuarray/extension.h>',
'<gpuarray/types.h>', '<cuda.h>']
def c_header_dirs(self):
import cuda_ndarray
......@@ -355,8 +355,8 @@ class GpuFromCuda(Op):
"""
def c_init_code(self):
return ['cuda_get_ctx = (CUcontext (*)(void *))compyte_get_extension("cuda_get_ctx");',
'cuda_make_buf = (gpudata *(*)(void *, CUdeviceptr, size_t))compyte_get_extension("cuda_make_buf");']
return ['cuda_get_ctx = (CUcontext (*)(void *))gpuarray_get_extension("cuda_get_ctx");',
'cuda_make_buf = (gpudata *(*)(void *, CUdeviceptr, size_t))gpuarray_get_extension("cuda_make_buf");']
def c_code(self, node, name, inputs, outputs, sub):
return """
......@@ -462,7 +462,7 @@ class CudaFromGpu(Op):
return shp
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):
import cuda_ndarray
......@@ -490,8 +490,8 @@ class CudaFromGpu(Op):
"""
def c_init_code(self):
return ['cuda_get_ctx = (CUcontext (*)(void *ctx))compyte_get_extension("cuda_get_ctx");',
'cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))compyte_get_extension("cuda_get_ptr");']
return ['cuda_get_ctx = (CUcontext (*)(void *ctx))gpuarray_get_extension("cuda_get_ctx");',
'cuda_get_ptr = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");']
def c_code(self, node, name, inputs, outputs, sub):
return """
......@@ -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);
if (err != GA_NO_ERROR) {
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),
(unsigned long)dims[0], (unsigned long)dims[1]);
%(fail)s;
......
......@@ -183,14 +183,14 @@ class GpuConv(gof.Op):
def c_headers(self):
return ['<stdio.h>', 'cuda.h',
'<compyte/extension.h>', '<numpy_compat.h>']
'<gpuarray/extension.h>', '<numpy_compat.h>']
def c_code_cache_version(self):
# raise this whenever modifying any of the support_code_files
return (0, 20)
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):
# REMEMBER TO RAISE c_code_cache_version when changing any of
......
......@@ -177,8 +177,8 @@ class GpuElemwise(HideC, Elemwise):
def c_headers(self):
if pygpu.get_default_context().kind == 'opencl':
raise MethodNotDefined('cuda only')
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>']
return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<gpuarray/ext_cuda.h>']
def c_compiler(self):
if pygpu.get_default_context().kind == 'opencl':
......@@ -678,8 +678,8 @@ class GpuCAReduceCuda(HideC, CAReduce):
return True
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>']
return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<gpuarray/ext_cuda.h>']
def c_compiler(self):
return NVCC_compiler
......@@ -2317,7 +2317,7 @@ class GpuCAReduceCuda(HideC, CAReduce):
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.
......@@ -2535,7 +2535,7 @@ class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype):
err = GpuKernel_call(&%(k_var)s, 0, %(ls)s, gs, args);
if (err != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError,
"compyte error: GpuCAReduceCPY: %%s.",
"gpuarray error: GpuCAReduceCPY: %%s.",
GpuKernel_error(&%(k_var)s, err));
%(fail)s
}
......@@ -2544,7 +2544,7 @@ class GpuCAReduceCPY(GpuKernelBase, HideC, CAReduceDtype):
err = GpuArray_move(&%(output)s->ga, &tmp->ga);
if (err != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError,
"compyte error: GpuCAReduceCPY [cast]: %%s.",
"gpuarray error: GpuCAReduceCPY [cast]: %%s.",
GpuArray_error(&tmp->ga, err));
%(fail)s
}
......
......@@ -48,8 +48,8 @@ class GpuImages2Neibs(Images2Neibs, Op):
return (9,1)
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>']
return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<gpuarray/ext_cuda.h>']
def c_compiler(self):
return NVCC_compiler
......
......@@ -47,7 +47,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias(Op):
return Apply(self, [x, b, y_idx], [nll, sm, am])
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):
dtype_x = node.inputs[0].dtype
......@@ -111,7 +111,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias(Op):
""" % locals()
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):
typecode_x = pygpu.gpuarray.dtype_to_typecode(node.inputs[0].dtype)
......@@ -300,7 +300,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op):
return (6,)
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):
return NVCC_compiler
......@@ -440,7 +440,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op):
""" % locals()
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()
......@@ -469,8 +469,8 @@ class GpuSoftmax (Op):
return (12,) + inline_softmax.code_version
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>']
return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<gpuarray/ext_cuda.h>']
def c_compiler(self):
return NVCC_compiler
......@@ -663,8 +663,8 @@ class GpuSoftmaxWithBias (Op):
return (11,) + inline_softmax.code_version
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>']
return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<gpuarray/ext_cuda.h>']
def c_compiler(self):
return NVCC_compiler
......@@ -852,4 +852,4 @@ class GpuSoftmaxWithBias (Op):
])
return (ret1 + "\n" + ret2) % locals()
gpu_softmax_with_bias = GpuSoftmaxWithBias()
\ No newline at end of file
gpu_softmax_with_bias = GpuSoftmaxWithBias()
......@@ -477,8 +477,8 @@ class GpuAdvancedIncSubtensor1_dev20(GpuAdvancedIncSubtensor1):
return (2,)
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<numpy_compat.h>',
'<compyte/ext_cuda.h>']
return ['cuda.h', '<gpuarray/extension.h>', '<numpy_compat.h>',
'<gpuarray/ext_cuda.h>']
def c_compiler(self):
return NVCC_compiler
......
......@@ -219,7 +219,8 @@ def test_transfer_cpu_gpu():
def test_transfer_strided():
# 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')
g = GpuArrayType(dtype='float32', broadcastable=(False, False))('g')
......
......@@ -207,15 +207,15 @@ class GpuArrayType(Type):
def c_headers(self):
# We need arrayobject for the PyArrayDescr struct def
# (even if we just use a pointer to it in a function def)
return ['<compyte/array.h>', '<compyte/kernel.h>', '<compyte/error.h>',
'<compyte/buffer_blas.h>', '<numpy/arrayobject.h>',
return ['<gpuarray/array.h>', '<gpuarray/kernel.h>', '<gpuarray/error.h>',
'<gpuarray/buffer_blas.h>', '<numpy/arrayobject.h>',
'<gpuarray_api.h>']
def c_header_dirs(self):
return [pygpu.get_include(), numpy.get_include()]
def c_libraries(self):
return ['compyte']
return ['gpuarray']
def c_code_cache_version(self):
ver = pygpu.gpuarray.api_version()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论