Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fix some warning about usage of __host__ functions in __device__ code #1809

Merged
merged 2 commits into from
Oct 10, 2022

Conversation

miscco
Copy link
Collaborator

@miscco miscco commented Oct 10, 2022

Internal CI improved handling of warnings so we goth those two new warnings about __host__ functions in __device__ code.

Luckily those are easy to work around

P.S. yes there is a typo but 🧛

Currently we cannot use `optional::value` on device, as that might throw if there is no value stored.

However, in `emplace` we know that there must be a value stored, as we have just created it.

Consequently, just return `this->_m_value`
Previously, we would use host `limits`, as it was not available at that time in libcu++. However, libcu++ has gained that support a long time ago so just use that.
@miscco
Copy link
Collaborator Author

miscco commented Oct 10, 2022

run tests

@miscco miscco requested review from wmaxey and gevtushenko October 10, 2022 09:33
@miscco miscco merged commit d641d63 into NVIDIA:main Oct 10, 2022
@miscco miscco deleted the nvbug_3826028 branch October 10, 2022 16:03
github-actions bot pushed a commit that referenced this pull request Oct 10, 2022
Fix some warning about usage of `__host__` functions in `__device__` code d641d63
github-actions bot pushed a commit to clayne/thrust that referenced this pull request Oct 10, 2022
…g_3826028

Fix some warning about usage of `__host__` functions in `__device__` code d641d63
@alliepiper alliepiper added this to the 2.1.0 milestone Mar 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants