niessner / Opt

Opt DSL
Other
254 stars 68 forks source link

There are no arguments to ‘min’ that depend on a template parameter #116

Closed mihaibujanca closed 6 years ago

mihaibujanca commented 6 years ago

I am getting the following error when trying to compile my project with Opt:

Opt/examples/shared/CudaArray.h:19:78: error: there are no arguments to ‘min’ that depend on a template parameter, so a declaration of ‘min’ must be available [-fpermissive]
         cudaSafeCall(cudaMemcpy(cpuBuffer, m_data, sizeof(T)*min(count,m_size), cudaMemcpyDeviceToHost));

Changing it to std::min solves it, happy to submit a PR with this if you're happy with the change.

Mx7f commented 6 years ago

Yeah, just make sure is included if its not already, I'm happy to merge any quick fixes like this to master.