Files
rocm-systems/projects/hip/tests/src/hipCKernel.c
T

21 строка
451 B
C
Исходник Обычный вид История

#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
2016-03-30 06:08:50 -05:00
__global__ void Kernel(hipLaunchParm lp, float *Ad){
int tx = threadIdx.x + blockIdx.x * blockDim.x;
2017-02-03 10:53:36 -06:00
Ad[tx] += Ad[tx-1];
2016-03-30 06:08:50 -05:00
}
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);
}