Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix string_build_config_mapper potentially becoming invalid due to ODR issues when restarting the runtime #1460

Merged
merged 4 commits into from
May 26, 2024

Conversation

illuhad
Copy link
Collaborator

@illuhad illuhad commented May 16, 2024

When no SYCL objects are around anymore, the AdaptiveCpp runtime shuts down. Because of this, defining multiple test cases as e.g. in catch2 causes runtime shutdown/restart patterns.
It seems that in this case, the string_build_config_mapper can become invalid as it might be destoryed when backends unload, and might then not be reconstructed correctly due to ODR issues.

This PR fixes this by moving kernel_configuration to the runtime, and moving the singleton definition for the name mapper to a .cpp file.

Hopefully fixes #1455
@TomMelt For me this fixes your issue. Can you confirm?

@illuhad illuhad force-pushed the hotfix/string-build-config-mapper-lifetime branch from 54acd1f to 87987b2 Compare May 16, 2024 23:34
@TomMelt
Copy link

TomMelt commented May 17, 2024

@illuhad , thanks so much for your help. The test runs successfully now.

I made sure to rebuild acpp using branch hotfix/string-build-config-mapper-lifetime, recompile the code and delete any previously cached JIT code from $HOME/.acpp/apps/

Here is the output:

$ ./a.out 
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
[AdaptiveCpp Warning] kernel_cache: This application run has resulted in new binaries being JIT-compiled. This indicates that the runtime optimization process has not yet reached peak performance. You may want to run the application again until this warning no longer appears to achieve optimal performance.
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
'+ptx89' is not a recognized feature for this target (ignoring feature)
===============================================================================
All tests passed (2048 assertions in 2 test cases)

@illuhad illuhad force-pushed the hotfix/string-build-config-mapper-lifetime branch from 83d5fea to c54b346 Compare May 25, 2024 23:55
@illuhad illuhad merged commit 31b7c42 into develop May 26, 2024
48 checks passed
@illuhad illuhad deleted the hotfix/string-build-config-mapper-lifetime branch May 26, 2024 02:29
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.

test code fails on first run
2 participants