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
parent 3c6203c814
commit cf526f5484
11 changed files with 1411 additions and 1418 deletions
+5 -5
View File
@@ -358,21 +358,21 @@ enum hipComputeMode {
*/
#if defined(__cplusplus) && !defined(__HIP_DISABLE_CPP_FUNCTIONS__)
template <class T>
static inline hipError_t hipMalloc(T** devPtr, size_t size) {
inline hipError_t hipMalloc(T** devPtr, size_t size) {
return hipMalloc((void**)devPtr, size);
}
// Provide an override to automatically typecast the pointer type from void**, and also provide a
// default for the flags.
template <class T>
static inline hipError_t hipHostMalloc(T** ptr, size_t size,
unsigned int flags = hipHostMallocDefault) {
inline hipError_t hipHostMalloc(T** ptr, size_t size,
unsigned int flags = hipHostMallocDefault) {
return hipHostMalloc((void**)ptr, size, flags);
}
template <class T>
static inline hipError_t hipMallocManaged(T** devPtr, size_t size,
unsigned int flags = hipMemAttachGlobal) {
inline hipError_t hipMallocManaged(T** devPtr, size_t size,
unsigned int flags = hipMemAttachGlobal) {
return hipMallocManaged((void**)devPtr, size, flags);
}
#endif