Files
rocm-systems/projects/hip/hipify-clang/src/CUDA2HipMap.h
T
Chris Kitching 199d75adc0 Make unsupported actually be a bool...
[ROCm/hip commit: 2f376c9b25]
2017-10-27 20:12:31 +01:00

40 lines
1.2 KiB
C++

#pragma once
#include "llvm/ADT/StringRef.h"
#include <set>
#include <map>
#include "Types.h"
// TODO: This shouldn't really be here. More restructuring needed...
struct hipCounter {
llvm::StringRef hipName;
ConvTypes countType;
ApiTypes countApiType;
bool unsupported;
};
#define HIP_UNSUPPORTED true
/// Macros to ignore.
extern const std::set<llvm::StringRef> CUDA_EXCLUDES;
/// Maps cuda header names to hip header names.
extern const std::map<llvm::StringRef, hipCounter> CUDA_INCLUDE_MAP;
/// Maps the names of CUDA types to the corresponding hip types.
extern const std::map<llvm::StringRef, hipCounter> CUDA_TYPE_NAME_MAP;
/// Map all other CUDA identifiers (function/macro names, enum values) to hip versions.
extern const std::map<llvm::StringRef, hipCounter> CUDA_IDENTIFIER_MAP;
/**
* The union of all the above maps.
*
* This should be used rarely, but is still needed to convert macro definitions (which can
* contain any combination of the above things). AST walkers can usually get away with just
* looking in the lookup table for the type of element they are processing, however, saving
* a great deal of time.
*/
const std::map<llvm::StringRef, hipCounter>& CUDA_RENAMES_MAP();