// RUN: %run_test hipify "%s" "%t" %hipify_args %clang_args // CHECK: #include #include #define THRUST_NS_QUALIFIER ::thrust // CHECK: #include #include // using namespace hipcub; using namespace cub; // Simple CUDA kernel for computing tiled partial sums template cub::BlockScanAlgorithm SCAN_ALGO> __global__ void ScanTilesKernel(int *d_in, int *d_out) { // Specialize collective types for problem context // CHECK: typedef ::hipcub::BlockLoad BlockLoadT; typedef ::cub::BlockLoad BlockLoadT; typedef BlockScan BlockScanT; // Allocate on-chip temporary storage __shared__ union { typename BlockLoadT::TempStorage load; typename BlockScanT::TempStorage reduce; } temp_storage; // Load data per thread int thread_data[ITEMS_PER_THREAD]; int offset = blockIdx.x * (BLOCK_THREADS * ITEMS_PER_THREAD); BlockLoadT(temp_storage.load).Load(d_in + offset, offset); __syncthreads(); // Compute the block-wide prefix sum BlockScanT(temp_storage).Sum(thread_data); }