Giter Club home page Giter Club logo

Comments (3)

gevtushenko avatar gevtushenko commented on June 9, 2024 1

Hello @lilohuang and thank you for reporting the issue! A bit simpler reproducer with the same behavior:

#include <nv/target>

template <class T> __device__ int device(T);

template <class T>
__device__ int doit_device(T val) {
  return device(val);
}

template <class T>
__host__ int doit_host(T val) {
  return 0;
}

template <class T>
int doit(T val) 
{
  NV_IF_TARGET(NV_IS_HOST,
                (return doit_host(val);),
                (return doit_device(val);));
}

int main() {
  return doit(42);
}

It seems that we have to guard the doit_device in Thrust to be something along the following lines:

template<class K, class... Args>
cudaError_t __device__
doit_device(K k, Args const&... args) const
{
  #ifdef THRUST_RDC_ENABLED
  const size_t size = argument_pack_size(0,args...);
  void *param_buffer = cudaGetParameterBuffer(64,size);
  fill_arguments((char*)param_buffer, 0, args...);
  return launch_device(k, param_buffer);
  #endif
}

from cub.

gevtushenko avatar gevtushenko commented on June 9, 2024 1

Merged NVIDIA/thrust#1939

from cub.

lilohuang avatar lilohuang commented on June 9, 2024

Awesome! Thank you @senior-zero. It worked! 💯 Please close this issue after merging NVIDIA/thrust#1939

from cub.

Related Issues (20)

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.