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

Cette révision appartient à :
Alex Voicu a créé et Maneesh Gupta a révisé 2019-12-23 19:09:38 +05:30
1 Parent 9c91632194
révision be70b9f7e7
11 fichiers modifiés
+1411 -1418

Aucun fichier ne correspond à votre recherche

+5 -5
Voir le fichier
@@ -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