static inline in a header, just like excess sugar in a diet, causes bloat (#1692)

This commit is contained in:
Alex Voicu
2019-12-23 15:39:38 +02:00
committed by Maneesh Gupta
vanhempi 9c91632194
commit be70b9f7e7
11 muutettua tiedostoa jossa 1411 lisäystä ja 1418 poistoa
+4 -4
Näytä tiedosto
@@ -308,17 +308,17 @@ static constexpr Coordinates<hip_impl::WorkitemId> threadIdx{};
extern "C" __device__ void* __hip_malloc(size_t);
extern "C" __device__ void* __hip_free(void* ptr);
static inline __device__ void* malloc(size_t size) { return __hip_malloc(size); }
static inline __device__ void* free(void* ptr) { return __hip_free(ptr); }
inline __device__ void* malloc(size_t size) { return __hip_malloc(size); }
inline __device__ void* free(void* ptr) { return __hip_free(ptr); }
#if defined(__HCC_ACCELERATOR__) && defined(HC_FEATURE_PRINTF)
template <typename... All>
static inline __device__ void printf(const char* format, All... all) {
inline __device__ void printf(const char* format, All... all) {
hc::printf(format, all...);
}
#elif defined(__HCC_ACCELERATOR__) || __HIP__
template <typename... All>
static inline __device__ void printf(const char* format, All... all) {}
inline __device__ void printf(const char* format, All... all) {}
#endif
#endif //__HCC_OR_HIP_CLANG__