2

Back in the days, std::vector was not allowed in CUDA device code. Is that still true with current cuda 10.2 toolkit with Unified Memory?

I have a few public data members of type std::vector in a class that is passed reference to be used by a device kernel.

nvcc complains about calling a host function("std::vector...) ... from a global function("...) not allowed.

What is the correct way to use unified memory, if at all possible, to use on an std::vector? If it is not possible, is there an efficient work-around?

1

1 Answer 1

1

Back in the days, std::vector was not allowed in CUDA device code. Is that still true with current cuda 10.2 toolkit with Unified Memory?

Yes.

What is the correct way to use unified memory, if at all possible, to use on an std::vector?

There is not one. It isn't possible. There is no C++ standard library support on the device.

If it is not possible, is there an efficient work-around?

No there is not.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.