This implements the trivial change needed to move back from the hip{Something}_{x, y, z} macros to the natural CUDA syntax of Something.{x, y, z}. This is contained in lines 384-404 in hip_runtime.h. All of the other changes have to do with changing unit tests to use this syntax. The macros are retained for backwards compatibility.
This commit is contained in:
@@ -30,7 +30,7 @@ THE SOFTWARE.
|
||||
#define ITER 1<<10
|
||||
|
||||
__global__ void Iter(hipLaunchParm lp, int *Ad, int num){
|
||||
int tx = hipThreadIdx_x + hipBlockIdx_x * hipBlockDim_x;
|
||||
int tx = threadIdx.x + blockIdx.x * blockDim.x;
|
||||
if(tx == 0){
|
||||
for(int i = 0; i<num;i++){
|
||||
Ad[tx] += 1;
|
||||
@@ -58,7 +58,7 @@ int main(){
|
||||
}
|
||||
|
||||
std::cout<<"Waitin..."<<std::endl;
|
||||
|
||||
|
||||
hipDeviceSynchronize();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||
static size_t size[NUM_SIZE];
|
||||
|
||||
__global__ void Add(hipLaunchParm lp, int *Ad){
|
||||
int tx = hipThreadIdx_x;
|
||||
int tx = threadIdx.x;
|
||||
Ad[tx] = Ad[tx] + tx;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||
static size_t size[NUM_SIZE];
|
||||
|
||||
__global__ void Add(hipLaunchParm lp, int *Ad){
|
||||
int tx = hipThreadIdx_x;
|
||||
int tx = threadIdx.x;
|
||||
Ad[tx] = Ad[tx] + tx;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ THE SOFTWARE.
|
||||
#define ITER 1<<10
|
||||
|
||||
__global__ void Iter(hipLaunchParm lp, int *Ad, int num){
|
||||
int tx = hipThreadIdx_x + hipBlockIdx_x * hipBlockDim_x;
|
||||
int tx = threadIdx.x + blockIdx.x * blockDim.x;
|
||||
if(tx == 0){
|
||||
for(int i = 0; i<num;i++){
|
||||
Ad[tx] += 1;
|
||||
@@ -57,7 +57,7 @@ int main(){
|
||||
}
|
||||
|
||||
std::cout<<"Waitin..."<<std::endl;
|
||||
|
||||
|
||||
hipDeviceSynchronize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user