金陆
2014-03-16 04:17:30 UTC
Hi, everyone
There is a simple code, but I found if I use "//CUPRINTF("\n\n");" in test.py, the yielded kernel.cu file is invalid. That is so strange, because 1."//unsigned int y=threadIdx.y; " dose not ruin the yielded kernel.cu; 2. if I use "/*CUPRINTF("\n\n");*/", there is no problem
I am using pycuda-2013.1.1.win32-py2.7.exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/ on Winxp
Thanks in advance
[test.py starts]
#coding=utf-8
import pycuda.driver as drv
import pycuda.autoinit
from pycuda.compiler import SourceModule
def compile_kernel(kernel_code, kernel_name):
mod = SourceModule(kernel_code)
func = mod.get_function(kernel_name)
return func
my_kernel_code = """
#include "math.h"
#include "stdio.h"
__global__ void my_kernel()
{
unsigned int x=threadIdx.x;
//unsigned int y=threadIdx.y;
//CUPRINTF("\n\n");
}
"""
kernel = compile_kernel(my_kernel_code, 'my_kernel')
if __name__ == '__main__':
pass
[test.py ends]
[kernel.cu starts]
extern "C" {
#include "math.h"
#include "stdio.h"
__global__ void my_kernel()
{
unsigned int x=threadIdx.x;
//unsigned int y=threadIdx.y;
//CUPRINTF("
");
}
}
[kernel.cu ends]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140316/6044bf3b/attachment.html>
There is a simple code, but I found if I use "//CUPRINTF("\n\n");" in test.py, the yielded kernel.cu file is invalid. That is so strange, because 1."//unsigned int y=threadIdx.y; " dose not ruin the yielded kernel.cu; 2. if I use "/*CUPRINTF("\n\n");*/", there is no problem
I am using pycuda-2013.1.1.win32-py2.7.exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/ on Winxp
Thanks in advance
[test.py starts]
#coding=utf-8
import pycuda.driver as drv
import pycuda.autoinit
from pycuda.compiler import SourceModule
def compile_kernel(kernel_code, kernel_name):
mod = SourceModule(kernel_code)
func = mod.get_function(kernel_name)
return func
my_kernel_code = """
#include "math.h"
#include "stdio.h"
__global__ void my_kernel()
{
unsigned int x=threadIdx.x;
//unsigned int y=threadIdx.y;
//CUPRINTF("\n\n");
}
"""
kernel = compile_kernel(my_kernel_code, 'my_kernel')
if __name__ == '__main__':
pass
[test.py ends]
[kernel.cu starts]
extern "C" {
#include "math.h"
#include "stdio.h"
__global__ void my_kernel()
{
unsigned int x=threadIdx.x;
//unsigned int y=threadIdx.y;
//CUPRINTF("
");
}
}
[kernel.cu ends]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20140316/6044bf3b/attachment.html>