Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Fix debug compilation with HIP#145

Merged
niermann999 merged 1 commit intoacts-project:mainfrom
StewMH:hip_assert
Sep 4, 2025
Merged

Fix debug compilation with HIP#145
niermann999 merged 1 commit intoacts-project:mainfrom
StewMH:hip_assert

Conversation

@StewMH
Copy link
Contributor

@StewMH StewMH commented Feb 19, 2025

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

@sonarqubecloud
Copy link

@StewMH
Copy link
Contributor 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
Contributor 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

@niermann999 niermann999 merged commit 240457f into acts-project:main Sep 4, 2025
28 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants