jholewinski / llvm-ptx-samples Goto Github PK
View Code? Open in Web Editor NEWSample programs for the LLVM PTX back-end
License: MIT License
Sample programs for the LLVM PTX back-end
License: MIT License
I admit I'm pretty new to the CUDA&PTX arena, so maybe I've done something stupid, but the examples refused to work for me. After much debugging and Googling, I found http://visionexperts.blogspot.com/2010/07/cuda-parameter-alignment.html
I'm running 64-bit Linux and a Quadro 4000, with a pretty recent top-of-tree LLVM build.
Sure enough, the examples started working for me after I changed the way array pointers were submitted. Does this seem reasonable? Is there a more elegant solution?
I also found http://developer.download.nvidia.com/compute/cuda/2_3/toolkit/docs/NVIDIA_CUDA_BestPracticesGuide_2.3.pdf which, in Listing 1.2, has an even slightly-more-complicated approach.
FROM:
// Bind kernel paramters
status = cuParamSetv(function, 0, &deviceA, sizeof(CUdeviceptr));
checkSuccess(status, "cuParamSetv");
status = cuParamSetv(function, sizeof(CUdeviceptr), &deviceB, sizeof(CUdeviceptr));
checkSuccess(status, "cuParamSetv");
status = cuParamSetv(function, 2*sizeof(CUdeviceptr), &deviceC, sizeof(CUdeviceptr));
checkSuccess(status, "cuParamSetv");
status = cuParamSeti(function, 3*sizeof(CUdeviceptr), problemSize);
checkSuccess(status, "cuParamSeti");
status = cuParamSetSize(function, 3*sizeof(CUdeviceptr) + sizeof(int));
checkSuccess(status, "cuParamSetSize");
TO:
// Bind kernel paramters
void *ptr;
ptr = (void*)(deviceA);
status = cuParamSetv(function, 0, &ptr, sizeof(void*));
checkSuccess(status, "cuParamSetv");
ptr = (void*)(deviceB);
status = cuParamSetv(function, sizeof(ptr), &ptr, sizeof(ptr));
checkSuccess(status, "cuParamSetv");
ptr = (void*)(deviceC);
status = cuParamSetv(function, 2*sizeof(ptr), &ptr, sizeof(ptr));
checkSuccess(status, "cuParamSetv");
status = cuParamSeti(function, 3*sizeof(ptr), problemSize);
checkSuccess(status, "cuParamSeti");
status = cuParamSetSize(function, 3*sizeof(ptr) + sizeof(int));
checkSuccess(status, "cuParamSetSize");
Re-integrate the Driver API samples into the build.
Manipulate real image data in the blur-2d sample.
Create a new build system based on make, or maybe ninja, to prevent the dependency on CMake.
Hello,
I'm running into trouble trying to create a kernel object from ptx:
Assertion failed: (result == CL_SUCCESS && "Failed to extract kernel"), function initialize, file /Users/cos/Projects/cs526/test2/llvm-ptx-samples/opencl/matmul/matmul.cpp, line 75.
Abort trap: 6
So it works for the lc but not for the ptx...
I'm using LLVM+Clang 3.2 on OS X.
Any ideas?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.