Mercurial > hg > Game > Cerium
changeset 1974:9ebee99a9aef draft
fix bitreverse for cuda(float2)
author | kkb |
---|---|
date | Wed, 26 Feb 2014 16:24:28 +0900 |
parents | 6dd11261489a |
children | 4cf85b48ab9e |
files | example/fft/cuda/bitReverse.cu example/regex_mas/main.cc |
diffstat | 2 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/example/fft/cuda/bitReverse.cu Wed Feb 26 13:35:57 2014 +0900 +++ b/example/fft/cuda/bitReverse.cu Wed Feb 26 16:24:28 2014 +0900 @@ -1,12 +1,7 @@ extern "C" { -#ifdef __APPLE__ -#include <OpenCL/opencl.h> -#else -#include <CL/cl.h> -#endif __global__ void - bitReverse(long* param, cl_float2* src, cl_float2* dst) + bitReverse(long* param, float* src, float* dst) { unsigned long gid = blockIdx.x*blockDim.x+threadIdx.x; // (unsigned long)s->get_param(0); unsigned long nid = blockIdx.y*blockDim.y+threadIdx.y; // (unsigned long)s->get_param(1); @@ -24,6 +19,7 @@ j >>= (32-m); - dst[nid*n+j] = src[nid*n+gid]; + dst[(nid*n+j)*2] = src[(nid*n+gid)*2]; + dst[(nid*n+j)*2+1] = src[(nid*n+gid)*2+1]; } }
--- a/example/regex_mas/main.cc Wed Feb 26 13:35:57 2014 +0900 +++ b/example/regex_mas/main.cc Wed Feb 26 16:24:28 2014 +0900 @@ -71,7 +71,10 @@ fprintf(stderr,"can't fstat %s\n",filename); } + //w->file_mmap = (char*)mmap(NULL,w->read_filesize,PROT_READ,map,fd,(off_t)0); + madvise(w->file_mmap, w->read_filesize, POSIX_MADV_NORMAL); w->file_mmap = (char*)mmap(NULL,w->read_filesize,PROT_READ,map,fd,(off_t)0); + if (st_mmap.file_mmap == (caddr_t)-1) { fprintf(stderr,"Can't mmap file\n"); perror(NULL);