Discussion:
[PyCUDA] MatrixTranspose.py example has CompileError
Bruce Labitt
2014-09-04 01:24:42 UTC
Permalink
Probably not the desired response. Can someone suggest a fix?
Thanks,
Bruce

In [3]: run MatrixTranspose.py
---------------------------------------------------------------------------
CompileError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
216
217 #check_transpose()
--> 218 run_benchmark()
219
220

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
182
183 for i in range(warmup):
--> 184 _transpose(target, source)
185
186 count = 10

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
117
118 def _transpose(tgt, src):
--> 119 krnl = _get_transpose_kernel()
120
121 w, h = src.shape

<string> in _get_transpose_kernel()

/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
47 A_t[glob_idx_a_t] = A_shared[threadIdx.x][threadIdx.y];
48 }
---> 49 """% {"block_size": block_size})
50
51 func = mod.get_function("transpose")

/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in __init__(self, source, nvcc, options, keep, no_extern_c, arch, code,
cache_dir, include_dirs)
249
250 cubin = compile(source, nvcc, options, keep, no_extern_c,
--> 251 arch, code, cache_dir, include_dirs)
252
253 from pycuda.driver import module_from_buffer

/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir,
include_dirs)
239 options.append("-I"+i)
240
--> 241 return compile_plain(source, options, keep, nvcc, cache_dir)
242
243

/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile_plain(source, options, keep, nvcc, cache_dir)
130 raise CompileError("nvcc compilation of %s failed" %
cu_file_path,
131 cmdline, stdout=stdout.decode("utf-8", "replace"),
--> 132 stderr=stderr.decode("utf-8", "replace"))
133
134 if stdout or stderr:

CompileError: nvcc compilation of /tmp/tmp5xdcrZ/kernel.cu failed
[command: nvcc --cubin -arch sm_30
-I/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/cuda
kernel.cu]
[stderr:
kernel.cu(10): error: "#" not expected here

kernel.cu(10): error: expected a ";"

kernel.cu(12): error: identifier "A_T_BLOCK_STRIDE" is undefined

3 errors detected in the compilation of
"/tmp/tmpxft_00001e6b_00000000-6_kernel.cpp1.ii".
]

In [4]:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140903/4a46f9b1/attachment.html>
Bogdan Opanchuk
2014-09-04 01:39:25 UTC
Permalink
Hi Bruce,

Seems to be a typo in the Wiki. If you look at
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose (where
MatrixTranspose.py originally comes from), you can see in line 24 two
"#define"s in one line. Incidentally, if someone has an account there,
could you fix that?

Best regards,
Bogdan
Post by Bruce Labitt
Probably not the desired response. Can someone suggest a fix?
Thanks,
Bruce
In [3]: run MatrixTranspose.py
---------------------------------------------------------------------------
CompileError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
216
217 #check_transpose()
--> 218 run_benchmark()
219
220
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
182
--> 184 _transpose(target, source)
185
186 count = 10
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
117
--> 119 krnl = _get_transpose_kernel()
120
121 w, h = src.shape
<string> in _get_transpose_kernel()
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
47 A_t[glob_idx_a_t] = A_shared[threadIdx.x][threadIdx.y];
48 }
---> 49 """% {"block_size": block_size})
50
51 func = mod.get_function("transpose")
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in __init__(self, source, nvcc, options, keep, no_extern_c, arch, code,
cache_dir, include_dirs)
249
250 cubin = compile(source, nvcc, options, keep, no_extern_c,
--> 251 arch, code, cache_dir, include_dirs)
252
253 from pycuda.driver import module_from_buffer
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir,
include_dirs)
239 options.append("-I"+i)
240
--> 241 return compile_plain(source, options, keep, nvcc, cache_dir)
242
243
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile_plain(source, options, keep, nvcc, cache_dir)
130 raise CompileError("nvcc compilation of %s failed" %
cu_file_path,
131 cmdline, stdout=stdout.decode("utf-8", "replace"),
--> 132 stderr=stderr.decode("utf-8", "replace"))
133
CompileError: nvcc compilation of /tmp/tmp5xdcrZ/kernel.cu failed
[command: nvcc --cubin -arch sm_30
-I/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/cuda
kernel.cu]
kernel.cu(10): error: "#" not expected here
kernel.cu(10): error: expected a ";"
kernel.cu(12): error: identifier "A_T_BLOCK_STRIDE" is undefined
3 errors detected in the compilation of
"/tmp/tmpxft_00001e6b_00000000-6_kernel.cpp1.ii".
]
_______________________________________________
PyCUDA mailing list
PyCUDA at tiker.net
http://lists.tiker.net/listinfo/pycuda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140904/1d36effa/attachment.html>
Bruce Labitt
2014-09-04 02:03:42 UTC
Permalink
Hi Bogdan,

Thanks for pointing that out. It seems that is not the only error in this
example. Adding a carriage return, and re-running yields a TypeError

In [5]: run MatrixTranspose.py
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
217
218 #check_transpose()
--> 219 run_benchmark()
220
221

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
183
184 for i in range(warmup):
--> 185 _transpose(target, source)
186
187 count = 10

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
118
119 def _transpose(tgt, src):
--> 120 krnl = _get_transpose_kernel()
121
122 w, h = src.shape

<string> in _get_transpose_kernel()

/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result

/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
51
52 func = mod.get_function("transpose")
---> 53 func.prepare("PPii", block=(block_size, block_size, 1))
54
55 from pytools import Record

TypeError: function_prepare() got an unexpected keyword argument 'block'

This TypeError occurs for
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose and the downloaded
wiki-examples (after fixing the double #defines on a line)

Best regards,
Bruce
Post by Bogdan Opanchuk
Hi Bruce,
Seems to be a typo in the Wiki. If you look at
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose (where
MatrixTranspose.py originally comes from), you can see in line 24 two
"#define"s in one line. Incidentally, if someone has an account there,
could you fix that?
Best regards,
Bogdan
Post by Bruce Labitt
Probably not the desired response. Can someone suggest a fix?
Thanks,
Bruce
In [3]: run MatrixTranspose.py
---------------------------------------------------------------------------
CompileError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
216
217 #check_transpose()
--> 218 run_benchmark()
219
220
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
182
--> 184 _transpose(target, source)
185
186 count = 10
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
117
--> 119 krnl = _get_transpose_kernel()
120
121 w, h = src.shape
<string> in _get_transpose_kernel()
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
47 A_t[glob_idx_a_t] = A_shared[threadIdx.x][threadIdx.y];
48 }
---> 49 """% {"block_size": block_size})
50
51 func = mod.get_function("transpose")
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in __init__(self, source, nvcc, options, keep, no_extern_c, arch, code,
cache_dir, include_dirs)
249
250 cubin = compile(source, nvcc, options, keep, no_extern_c,
--> 251 arch, code, cache_dir, include_dirs)
252
253 from pycuda.driver import module_from_buffer
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir,
include_dirs)
239 options.append("-I"+i)
240
--> 241 return compile_plain(source, options, keep, nvcc, cache_dir)
242
243
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile_plain(source, options, keep, nvcc, cache_dir)
130 raise CompileError("nvcc compilation of %s failed" %
cu_file_path,
131 cmdline, stdout=stdout.decode("utf-8", "replace"),
--> 132 stderr=stderr.decode("utf-8", "replace"))
133
CompileError: nvcc compilation of /tmp/tmp5xdcrZ/kernel.cu failed
[command: nvcc --cubin -arch sm_30
-I/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/cuda
kernel.cu]
kernel.cu(10): error: "#" not expected here
kernel.cu(10): error: expected a ";"
kernel.cu(12): error: identifier "A_T_BLOCK_STRIDE" is undefined
3 errors detected in the compilation of
"/tmp/tmpxft_00001e6b_00000000-6_kernel.cpp1.ii".
]
_______________________________________________
PyCUDA mailing list
PyCUDA at tiker.net
http://lists.tiker.net/listinfo/pycuda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140903/0b8c9395/attachment-0001.html>
Bogdan Opanchuk
2014-09-04 02:46:25 UTC
Permalink
Hi Bruce,

Looks like the docs for Function.prepare() are a bit outdated, I've created
a PR for that. As for the example, since I cannot register on the wiki
(some cryptic error appears), I've created a gist with the corrected
version: https://gist.github.com/Manticore/6ff4400cde2750e61bff

Fixes:
- Py3 safe
- Fixed indentation in run_benchmark()
- Fixed repetition of test sizes in run_benchmark()
- Added labels to the graphs and some description to the output

Best regards,
Bogdan
Post by Bruce Labitt
Hi Bogdan,
Thanks for pointing that out. It seems that is not the only error in this
example. Adding a carriage return, and re-running yields a TypeError
In [5]: run MatrixTranspose.py
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
217
218 #check_transpose()
--> 219 run_benchmark()
220
221
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
183
--> 185 _transpose(target, source)
186
187 count = 10
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
118
--> 120 krnl = _get_transpose_kernel()
121
122 w, h = src.shape
<string> in _get_transpose_kernel()
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
51
52 func = mod.get_function("transpose")
---> 53 func.prepare("PPii", block=(block_size, block_size, 1))
54
55 from pytools import Record
TypeError: function_prepare() got an unexpected keyword argument 'block'
This TypeError occurs for
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose and the downloaded
wiki-examples (after fixing the double #defines on a line)
Best regards,
Bruce
Post by Bogdan Opanchuk
Hi Bruce,
Seems to be a typo in the Wiki. If you look at
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose (where
MatrixTranspose.py originally comes from), you can see in line 24 two
"#define"s in one line. Incidentally, if someone has an account there,
could you fix that?
Best regards,
Bogdan
Post by Bruce Labitt
Probably not the desired response. Can someone suggest a fix?
Thanks,
Bruce
In [3]: run MatrixTranspose.py
---------------------------------------------------------------------------
CompileError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
216
217 #check_transpose()
--> 218 run_benchmark()
219
220
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
182
--> 184 _transpose(target, source)
185
186 count = 10
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
117
--> 119 krnl = _get_transpose_kernel()
120
121 w, h = src.shape
<string> in _get_transpose_kernel()
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
47 A_t[glob_idx_a_t] = A_shared[threadIdx.x][threadIdx.y];
48 }
---> 49 """% {"block_size": block_size})
50
51 func = mod.get_function("transpose")
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in __init__(self, source, nvcc, options, keep, no_extern_c, arch, code,
cache_dir, include_dirs)
249
250 cubin = compile(source, nvcc, options, keep, no_extern_c,
--> 251 arch, code, cache_dir, include_dirs)
252
253 from pycuda.driver import module_from_buffer
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir,
include_dirs)
239 options.append("-I"+i)
240
--> 241 return compile_plain(source, options, keep, nvcc, cache_dir)
242
243
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile_plain(source, options, keep, nvcc, cache_dir)
130 raise CompileError("nvcc compilation of %s failed" %
cu_file_path,
131 cmdline, stdout=stdout.decode("utf-8", "replace"),
--> 132 stderr=stderr.decode("utf-8", "replace"))
133
CompileError: nvcc compilation of /tmp/tmp5xdcrZ/kernel.cu failed
[command: nvcc --cubin -arch sm_30
-I/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/cuda
kernel.cu]
kernel.cu(10): error: "#" not expected here
kernel.cu(10): error: expected a ";"
kernel.cu(12): error: identifier "A_T_BLOCK_STRIDE" is undefined
3 errors detected in the compilation of
"/tmp/tmpxft_00001e6b_00000000-6_kernel.cpp1.ii".
]
_______________________________________________
PyCUDA mailing list
PyCUDA at tiker.net
http://lists.tiker.net/listinfo/pycuda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140904/e8805386/attachment.html>
Bogdan Opanchuk
2014-09-04 03:02:04 UTC
Permalink
P.S. Fixes include corrected invocations of prepare() and prepared_call(),
of course.
Post by Bogdan Opanchuk
Hi Bruce,
Looks like the docs for Function.prepare() are a bit outdated, I've
created a PR for that. As for the example, since I cannot register on the
wiki (some cryptic error appears), I've created a gist with the corrected
version: https://gist.github.com/Manticore/6ff4400cde2750e61bff
- Py3 safe
- Fixed indentation in run_benchmark()
- Fixed repetition of test sizes in run_benchmark()
- Added labels to the graphs and some description to the output
Best regards,
Bogdan
Post by Bruce Labitt
Hi Bogdan,
Thanks for pointing that out. It seems that is not the only error in
this example. Adding a carriage return, and re-running yields a TypeError
In [5]: run MatrixTranspose.py
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
217
218 #check_transpose()
--> 219 run_benchmark()
220
221
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
183
--> 185 _transpose(target, source)
186
187 count = 10
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
118
--> 120 krnl = _get_transpose_kernel()
121
122 w, h = src.shape
<string> in _get_transpose_kernel()
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
51
52 func = mod.get_function("transpose")
---> 53 func.prepare("PPii", block=(block_size, block_size, 1))
54
55 from pytools import Record
TypeError: function_prepare() got an unexpected keyword argument 'block'
This TypeError occurs for
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose and the downloaded
wiki-examples (after fixing the double #defines on a line)
Best regards,
Bruce
Post by Bogdan Opanchuk
Hi Bruce,
Seems to be a typo in the Wiki. If you look at
http://wiki.tiker.net/PyCuda/Examples/MatrixTranspose (where
MatrixTranspose.py originally comes from), you can see in line 24 two
"#define"s in one line. Incidentally, if someone has an account there,
could you fix that?
Best regards,
Bogdan
Post by Bruce Labitt
Probably not the desired response. Can someone suggest a fix?
Thanks,
Bruce
In [3]: run MatrixTranspose.py
---------------------------------------------------------------------------
CompileError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in
execfile(fname, *where)
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
<module>()
216
217 #check_transpose()
--> 218 run_benchmark()
219
220
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
run_benchmark()
182
--> 184 _transpose(target, source)
185
186 count = 10
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_transpose(tgt, src)
117
--> 119 krnl = _get_transpose_kernel()
120
121 w, h = src.shape
<string> in _get_transpose_kernel()
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/tools.pyc
in context_dependent_memoize(func, *args)
421 context_dependent_memoized_functions.append(func)
422 arg_dict = ctx_dict.setdefault(cur_ctx, {})
--> 423 result = func(*args)
424 arg_dict[args] = result
425 return result
/home/bruce/Apps/pycuda/examples/wiki-examples/MatrixTranspose.py in
_get_transpose_kernel()
47 A_t[glob_idx_a_t] = A_shared[threadIdx.x][threadIdx.y];
48 }
---> 49 """% {"block_size": block_size})
50
51 func = mod.get_function("transpose")
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in __init__(self, source, nvcc, options, keep, no_extern_c, arch, code,
cache_dir, include_dirs)
249
250 cubin = compile(source, nvcc, options, keep, no_extern_c,
--> 251 arch, code, cache_dir, include_dirs)
252
253 from pycuda.driver import module_from_buffer
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir,
include_dirs)
239 options.append("-I"+i)
240
--> 241 return compile_plain(source, options, keep, nvcc, cache_dir)
242
243
/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.pyc
in compile_plain(source, options, keep, nvcc, cache_dir)
130 raise CompileError("nvcc compilation of %s failed" %
cu_file_path,
131 cmdline, stdout=stdout.decode("utf-8", "replace"),
--> 132 stderr=stderr.decode("utf-8", "replace"))
133
CompileError: nvcc compilation of /tmp/tmp5xdcrZ/kernel.cu failed
[command: nvcc --cubin -arch sm_30
-I/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/cuda
kernel.cu]
kernel.cu(10): error: "#" not expected here
kernel.cu(10): error: expected a ";"
kernel.cu(12): error: identifier "A_T_BLOCK_STRIDE" is undefined
3 errors detected in the compilation of
"/tmp/tmpxft_00001e6b_00000000-6_kernel.cpp1.ii".
]
_______________________________________________
PyCUDA mailing list
PyCUDA at tiker.net
http://lists.tiker.net/listinfo/pycuda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140904/36608d81/attachment-0001.html>
Andreas Kloeckner
2014-09-04 23:34:35 UTC
Permalink
Post by Bogdan Opanchuk
P.S. Fixes include corrected invocations of prepare() and prepared_call(),
of course.
Updated. For future reference--you can't sign up for user accounts, but
you *can* edit anonymously on that wiki.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140904/61c381f5/attachment.sig>
Loading...