Files
rocm-systems/tests/src/hipCKernel.c
T
Aditya Atluri 5e3d63c0a3 changed __global__ attribute
1. Moved around tests and added them to HIT

Change-Id: I5d75280c42a5af852670ebabc7305ee56721ec7b
2017-02-03 10:53:36 -06:00

21 строка
460 B
C

#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
__global__ void Kernel(hipLaunchParm lp, float *Ad){
int tx = hipThreadIdx_x + hipBlockIdx_x * hipBlockDim_x;
Ad[tx] += Ad[tx-1];
}
int main(){
dim3 dimBlock;
dim3 dimGrid;
dimGrid.x = 1;
dimGrid.y = 1;
dimGrid.z = 1;
dimBlock.x = 1;
dimBlock.y = 1;
dimBlock.z = 1;
float *A;
hipLaunchKernel(HIP_KERNEL_NAME(Kernel), dimGrid, dimBlock, 0, 0, A);
}