Giter Club home page Giter Club logo

llvm-ptx-samples's People

Contributors

jholewinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

llvm-ptx-samples's Issues

32/64 bit OS/GPU issues with cuParamSetv

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");

New Build System

Create a new build system based on make, or maybe ninja, to prevent the dependency on CMake.

ran into trouble when running the samples

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.