Closed joelself closed 8 years ago
Ok, I found the problem: in src/lib/THClSortUtils.cl
bitonicSort(&sharedKeys, &sharedValues, &sharedValid);
The &
's are unnecessary since the variables are already arrays. Here's a minimal recreation:
This compiles fine:
void test_func(float *junk) {}
int main() {
float stuff[16];
test_func(stuff);
}
But change the call to test_func
to:
test_func(&stuff);
and you get this on compile:
test.cpp: In function ‘int main()’:
test.cpp:4:18: error: cannot convert ‘float (*)[16]’ to ‘float*’ for argument ‘1’ to ‘void test_func(float*)’
test_func(&stuff);
Which is pretty close to the error I'm getting when I run cltorch.test
.
Nice spot, thanks! I merged your change, as a22b207 . Can you pull down the latest version and retry?
It's on a different video card (I had to switch to an NVidia card when cltorch wouldn't work and I don't have the time to switch back right now, but I'll try tonight), but it works!
Completed 195 asserts in 117 tests with 0 failures and 0 errors
all tests finished
When I run
luajit -l cltorch -e 'cltorch.test()'
I get this at the end:OS: Ubuntu 14.04 x86_64 CPU: Intel Core i5-2500K RAM: 8 GB of something Graphics: XFX AMD R9 280x Lua: LuaJIT 2.1.0-beta1 g++ -v:
g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
Full Error:
th -l cltorch -e 'cltorch.about()'
I'd like to include logs, but I don't know where they are.
Edit: Probably a better title for this would be
Test error: "__local float (*)[128]" is incompatible with parameter of type "__local float *"
Edit: Oh right, I can edit titles.