Skip to content

magnetostatics: guard DipolarDirectSum gpu=True without CUDA (bug-sweep #31)#5363

Draft
RudolfWeeber wants to merge 1 commit into
espressomd:pythonfrom
RudolfWeeber:fix/bug-31-dipolardirectsum-gpu-guard
Draft

magnetostatics: guard DipolarDirectSum gpu=True without CUDA (bug-sweep #31)#5363
RudolfWeeber wants to merge 1 commit into
espressomd:pythonfrom
RudolfWeeber:fix/bug-31-dipolardirectsum-gpu-guard

Conversation

@RudolfWeeber

Copy link
Copy Markdown
Contributor

DipolarDirectSum::do_construct forwarded the gpu flag straight into the
core actor (m_is_gpu=true) with no feature check, unlike the analogous
CoulombP3M path. On a CUDA-off build this constructed and activated
silently; the first force/energy call then either hit assert(not
m_is_gpu) (debug) or silently computed on CPU while is_gpu() reported
True (release) -- a capability misreport.

Mirror the CoulombP3M convention: at the script-interface seam, if
gpu=True, add 'CUDA' to required_features and call
CodeInfo::check_features inside parallel_try_catch, so the unsupported
request surfaces as a clean RuntimeError ("Missing features CUDA")
before the core actor is created.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

🤖 Generated with Claude Code

#31)

DipolarDirectSum::do_construct forwarded the gpu flag straight into the
core actor (m_is_gpu=true) with no feature check, unlike the analogous
CoulombP3M path. On a CUDA-off build this constructed and activated
silently; the first force/energy call then either hit assert(not
m_is_gpu) (debug) or silently computed on CPU while is_gpu() reported
True (release) -- a capability misreport.

Mirror the CoulombP3M convention: at the script-interface seam, if
gpu=True, add 'CUDA' to required_features and call
CodeInfo::check_features inside parallel_try_catch, so the unsupported
request surfaces as a clean RuntimeError ("Missing features CUDA")
before the core actor is created.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant