Fixed HIP for C runtime
1. fixed constant memory test 2. added runtime gcc/g++ test 3. added fix for runtime with gcc/g++ Change-Id: Ie14dad6633411b188bdeea044e140b6d5beabe16
このコミットが含まれているのは:
@@ -26,12 +26,9 @@ THE SOFTWARE.
|
||||
#include<hip/hcc_detail/driver_types.h>
|
||||
#include<hip/hcc_detail/hip_vector_types.h>
|
||||
|
||||
hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, hipChannelFormatKind f);
|
||||
#ifdef __cplusplus
|
||||
|
||||
template<typename T>
|
||||
static inline hipChannelFormatDesc hipCreateChannelDesc() {
|
||||
return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone);
|
||||
}
|
||||
hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, hipChannelFormatKind f);
|
||||
|
||||
static inline hipChannelFormatDesc hipCreateChannelDescHalf() {
|
||||
int e = (int)sizeof(unsigned short) * 8;
|
||||
@@ -49,6 +46,11 @@ static inline hipChannelFormatDesc hipCreateChannelDescHalf2()
|
||||
return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline hipChannelFormatDesc hipCreateChannelDesc() {
|
||||
return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline hipChannelFormatDesc hipCreateChannelDesc<char>()
|
||||
{
|
||||
@@ -371,4 +373,10 @@ inline hipChannelFormatDesc hipCreateChannelDesc<long4>()
|
||||
return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
struct hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, enum hipChannelFormatKind f);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -180,7 +180,7 @@ typedef enum hipMemcpyKind {
|
||||
typedef struct {
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
hipChannelFormatKind f;
|
||||
enum hipChannelFormatKind f;
|
||||
void* data; //FIXME: generalize this
|
||||
} hipArray;
|
||||
|
||||
@@ -371,7 +371,7 @@ hipError_t hipDeviceGetCacheConfig ( hipFuncCache_t *cacheConfig );
|
||||
* Note: Currently, only hipLimitMallocHeapSize is available
|
||||
*
|
||||
*/
|
||||
hipError_t hipDeviceGetLimit(size_t *pValue, hipLimit_t limit);
|
||||
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit);
|
||||
|
||||
|
||||
/**
|
||||
@@ -1254,9 +1254,13 @@ hipError_t hipMemGetInfo (size_t * free, size_t * total) ;
|
||||
*
|
||||
* @see hipMalloc, hipMallocPitch, hipFree, hipFreeArray, hipHostMalloc, hipHostFree
|
||||
*/
|
||||
#if __cplusplus
|
||||
hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc,
|
||||
size_t width, size_t height = 0, unsigned int flags = 0);
|
||||
|
||||
#else
|
||||
hipError_t hipMallocArray(hipArray** array, const struct hipChannelFormatDesc* desc,
|
||||
size_t width, size_t height, unsigned int flags);
|
||||
#endif
|
||||
/**
|
||||
* @brief Frees an array on the device.
|
||||
*
|
||||
|
||||
@@ -31,6 +31,7 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <hip/hcc_detail/driver_types.h>
|
||||
#include <hip/hcc_detail/channel_descriptor.h>
|
||||
#include <hip/hcc_detail/texture_types.h>
|
||||
//#include <hip/hcc_detail/hip_runtime.h>
|
||||
|
||||
@@ -34,9 +34,9 @@ enum hipTextureFilterMode
|
||||
};
|
||||
|
||||
struct textureReference {
|
||||
hipTextureFilterMode filterMode;
|
||||
bool normalized;
|
||||
hipChannelFormatDesc channelDesc;
|
||||
enum hipTextureFilterMode filterMode;
|
||||
unsigned normalized;
|
||||
struct hipChannelFormatDesc channelDesc;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#include<hip/hip_runtime_api.h>
|
||||
#include<iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
int *Ad;
|
||||
hipMalloc((void**)&Ad, 1024);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include<hip/hip_runtime_api.h>
|
||||
#include<stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int *Ad;
|
||||
hipMalloc((void**)&Ad, 1024);
|
||||
}
|
||||
@@ -26,6 +26,7 @@ THE SOFTWARE.
|
||||
#include<hip/hip_runtime.h>
|
||||
#include<hip/hip_runtime_api.h>
|
||||
#include<iostream>
|
||||
#include "test_common.h"
|
||||
|
||||
#define HIP_ASSERT(status) \
|
||||
assert(status == hipSuccess)
|
||||
@@ -62,4 +63,5 @@ int main()
|
||||
{
|
||||
assert(A[i] == B[i]);
|
||||
}
|
||||
passed();
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする