Altera_Forum
Honored Contributor
8 years agoCompiler Error: Multiple channel write sites.
Hi,
My code as follows: #ifndef SIMD_WORK_ITEMS #define SIMD_WORK_ITEMS 4 // default value #endif #pragma OPENCL_EXTENSION cl_altera_channels : enable // Channel declarations channel int DATA __attribute__((depth(8))); __kernel __attribute((reqd_work_group_size(BLOCK_SIZE,BLOCK_SIZE,1))) __attribute((num_simd_work_items(SIMD_WORK_ITEMS))) void matrixMult( __global int *restrict A, __global int *restrict B) { // Write result to channel int off = get_global_id(1) * get_global_size(0) + get_global_id(0); int running_sum = A[off] * B[off]; write_channel_altera(DATA, running_sum); } __kernel void FindMinAndMax(int size, __global int *restrict data) { int min_temp = 0; int max_temp = 0; for (int i = 0; i < size; i++) { int val = read_channel_altera(DATA); min_temp = min(min_temp, val); max_temp = max(max_temp, val); data[i] = val; } } When I compile the kernels with command "aoc device/matrix_mult_bak.cl -o bin/matrix_mult_bak.aocx --report -v", it print out errors "Compiler Error: Multiple channel write sites.". What the error means?How to solve the problem?Thank you!