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
Este cometimento está contido em:
@@ -26,12 +26,9 @@ THE SOFTWARE.
|
|||||||
#include<hip/hcc_detail/driver_types.h>
|
#include<hip/hcc_detail/driver_types.h>
|
||||||
#include<hip/hcc_detail/hip_vector_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>
|
hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, hipChannelFormatKind f);
|
||||||
static inline hipChannelFormatDesc hipCreateChannelDesc() {
|
|
||||||
return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline hipChannelFormatDesc hipCreateChannelDescHalf() {
|
static inline hipChannelFormatDesc hipCreateChannelDescHalf() {
|
||||||
int e = (int)sizeof(unsigned short) * 8;
|
int e = (int)sizeof(unsigned short) * 8;
|
||||||
@@ -49,6 +46,11 @@ static inline hipChannelFormatDesc hipCreateChannelDescHalf2()
|
|||||||
return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat);
|
return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline hipChannelFormatDesc hipCreateChannelDesc() {
|
||||||
|
return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone);
|
||||||
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline hipChannelFormatDesc hipCreateChannelDesc<char>()
|
inline hipChannelFormatDesc hipCreateChannelDesc<char>()
|
||||||
{
|
{
|
||||||
@@ -371,4 +373,10 @@ inline hipChannelFormatDesc hipCreateChannelDesc<long4>()
|
|||||||
return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned);
|
return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, enum hipChannelFormatKind f);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ typedef enum hipMemcpyKind {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
hipChannelFormatKind f;
|
enum hipChannelFormatKind f;
|
||||||
void* data; //FIXME: generalize this
|
void* data; //FIXME: generalize this
|
||||||
} hipArray;
|
} hipArray;
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ hipError_t hipDeviceGetCacheConfig ( hipFuncCache_t *cacheConfig );
|
|||||||
* Note: Currently, only hipLimitMallocHeapSize is available
|
* 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
|
* @see hipMalloc, hipMallocPitch, hipFree, hipFreeArray, hipHostMalloc, hipHostFree
|
||||||
*/
|
*/
|
||||||
|
#if __cplusplus
|
||||||
hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc,
|
hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc,
|
||||||
size_t width, size_t height = 0, unsigned int flags = 0);
|
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.
|
* @brief Frees an array on the device.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ THE SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <hip/hcc_detail/driver_types.h>
|
||||||
#include <hip/hcc_detail/channel_descriptor.h>
|
#include <hip/hcc_detail/channel_descriptor.h>
|
||||||
#include <hip/hcc_detail/texture_types.h>
|
#include <hip/hcc_detail/texture_types.h>
|
||||||
//#include <hip/hcc_detail/hip_runtime.h>
|
//#include <hip/hcc_detail/hip_runtime.h>
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ enum hipTextureFilterMode
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct textureReference {
|
struct textureReference {
|
||||||
hipTextureFilterMode filterMode;
|
enum hipTextureFilterMode filterMode;
|
||||||
bool normalized;
|
unsigned normalized;
|
||||||
hipChannelFormatDesc channelDesc;
|
struct hipChannelFormatDesc channelDesc;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#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.h>
|
||||||
#include<hip/hip_runtime_api.h>
|
#include<hip/hip_runtime_api.h>
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
|
#include "test_common.h"
|
||||||
|
|
||||||
#define HIP_ASSERT(status) \
|
#define HIP_ASSERT(status) \
|
||||||
assert(status == hipSuccess)
|
assert(status == hipSuccess)
|
||||||
@@ -62,4 +63,5 @@ int main()
|
|||||||
{
|
{
|
||||||
assert(A[i] == B[i]);
|
assert(A[i] == B[i]);
|
||||||
}
|
}
|
||||||
|
passed();
|
||||||
}
|
}
|
||||||
|
|||||||
Criar uma nova questão referindo esta
Bloquear um utilizador