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 debug compilation with HIP #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StewMH
Copy link

@StewMH StewMH commented Feb 19, 2025

Add HIP runtime header for assert when compiling as a HIP source file: avoid host/device function issues.

@StewMH
Copy link
Author

StewMH commented Feb 19, 2025

Actually this only solves one of the instances of assert, which is enough for the current traccc alpaka hip implementation. If we don't want to replicate this ifdef across a lot of files we probably need a dedicated header e.g. #include <device_assert.hpp>?

@niermann999
Copy link
Contributor

Actually this only solves one of the instances of assert, which is enough for the current traccc alpaka hip implementation. If we don't want to replicate this ifdef across a lot of files we probably need a dedicated header e.g. #include <device_assert.hpp>?

Yes, I think such a header would be good, don't know what other peoples opinions are

@StewMH
Copy link
Author

StewMH commented Feb 25, 2025

I haven't managed to provoke more of these errors in my tests: maybe we just go ahead with this and revisit if more instances are needed.

@niermann999
Copy link
Contributor

I haven't managed to provoke more of these errors in my tests: maybe we just go ahead with this and revisit if more instances are needed.

Sorry for the late reply! Even if we use it only in one place, could we still put it in a dedicated header? I think that would make it both more readable and extendible in future. E.g. common/assert.hpp or something similar

/**
 * ALGEBRA PLUGIN library, part of the ACTS project (R&D line)
 *
 * (c) 2025 CERN for the benefit of the ACTS project
 *
 * Mozilla Public License Version 2.0
 */

#pragma once

#include <cassert>

#if defined(__HIP__)
#include <hip/hip_runtime.h>
#endif

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.

2 participants