Skip to content

Commit

Permalink
Mark HIP specific headers with a warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVlx committed Oct 10, 2018
1 parent 688cf17 commit b710acd
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ add_custom_command(TARGET clang_links POST_BUILD
)

# install certain LLVM libraries needed by HIP
# TODO: why HIP needs this random soup is unclear; the HC specific passes are
# definitely not "certain LLVM libraries needed by HIP".
install(PROGRAMS $<TARGET_FILE:LLVMAMDGPUDesc>
$<TARGET_FILE:LLVMAMDGPUUtils>
$<TARGET_FILE:LLVMMC>
Expand All @@ -374,7 +376,6 @@ install(PROGRAMS $<TARGET_FILE:LLVMAMDGPUDesc>
$<TARGET_FILE:LLVMPromotePointerKernArgsToGlobal>
$<TARGET_FILE:LLVMSelectAcceleratorCode>
$<TARGET_FILE:LLVMUndefineGlobalsInAcceleratorCode>
$<TARGET_FILE:LLVMHello>
DESTINATION lib
COMPONENT compiler
)
Expand Down
4 changes: 4 additions & 0 deletions include/hc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include "hc_defines.h"
#include "kalmar_exception.h"
#include "kalmar_runtime.h"
Expand Down
4 changes: 4 additions & 0 deletions include/hc_am.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include "hc.hpp"
#include <cstddef>
#include <mutex>
Expand Down
4 changes: 4 additions & 0 deletions include/hc_am_internal.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include "hc_am.hpp"

namespace hc {
Expand Down
4 changes: 4 additions & 0 deletions include/hc_defines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

// C++ headers
#include <algorithm>
#include <cassert>
Expand Down
4 changes: 4 additions & 0 deletions include/hc_math.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include "hc.hpp"
#include <cmath>

Expand Down
4 changes: 4 additions & 0 deletions include/hc_printf.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include <type_traits>
#include <cstdlib>
#include <cstdio>
Expand Down
4 changes: 4 additions & 0 deletions include/hc_rt_debug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include <cstdlib>
#include <cstdio>
#ifndef USE_LIBCXX
Expand Down
4 changes: 4 additions & 0 deletions include/hcc_features.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
//
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

//
// If set, am_memtracker_update API accepts appPtr parm
#define __HCC_HAS_EXTENDED_AM_MEMTRACKER_UPDATE (1)
Expand Down
4 changes: 4 additions & 0 deletions include/kalmar_aligned_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include <cassert>
#include <memory>
#include <stdlib.h>
Expand Down
4 changes: 4 additions & 0 deletions include/kalmar_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include <string>
#include <exception>

Expand Down
4 changes: 4 additions & 0 deletions include/kalmar_runtime.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if !defined(__HIPCC__)
#warning "This header is only intended for HIP usage, and not for direct inclusion."
#endif

#include "hc_defines.h"
#include "kalmar_aligned_alloc.h"

Expand Down

0 comments on commit b710acd

Please sign in to comment.