cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
s.corda
Participant
Participant
380 Views
Registered: ‎02-27-2019

Multiple compute units kernel name

Hi,

I am trying to run multiple compute units on an Alveo U50.

I am facing some issue in programming the different units on the host side.

This code works:

OCL_CHECK(err, kernels[0] = cl::Kernel(program,"vadd:{vadd_1}", &err));

OCL_CHECK(err, kernels[1] = cl::Kernel(program,"vadd:{vadd_2}", &err));

The following code is not working:

OCL_CHECK(err, kernels[0] = cl::Kernel(program, "vadd" , &err));

Also this one is not working:

OCL_CHECK(err, kernels[0] = cl::Kernel(program, kernel_name.c_str() , &err));

where kernel_name is a c++ string and contains "vadd:{vadd_1}" or "vadd:{vadd_2}".

 

Is there a way to solve this issue without unrolling manually the loop?

 

Thanks

0 Kudos
2 Replies
ViratAgarwal
Xilinx Employee
Xilinx Employee
272 Views
Registered: ‎06-24-2020

Hi @s.corda ,

 

Can you please mention all the changes you made (All the changes you made for each case)? Also can you please mention the errors you are observing for the respective cases you tried?

0 Kudos
s.corda
Participant
Participant
195 Views
Registered: ‎02-27-2019

Hi ,
Before I tried on my design I checked on the multiple compute units example available on github.
It seems that the multiple units are not inferred with:
for (int i = 0; i < num_cu; i++) {
OCL_CHECK(err, krnls[i] = cl::Kernel(program, "vadd", &err));
}
The following code works (it is not elegant):
OCL_CHECK(err, krnls[0] = cl::Kernel(program, "vadd:{vadd_1}", &err));
OCL_CHECK(err, krnls[1] = cl::Kernel(program, "vadd:{vadd_2}", &err));
OCL_CHECK(err, krnls[2] = cl::Kernel(program, "vadd:{vadd_3}", &err));
OCL_CHECK(err, krnls[3] = cl::Kernel(program, "vadd:{vadd_4}", &err));
Moreover, when I am specifying the HBM bank (and adding the gmem0, gmem1... interfaces in vadd.cpp) in the Vitis GUI, if I leave the default code in host.cpp I am getting:
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_1' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_2' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_3' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_1' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_2' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_3' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_1' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_2' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_3' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_1' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_2' cannot be used with this argument and is ignored.
[XRT] WARNING: Argument '0' of kernel 'vadd' is allocated in memory bank 'HBM[20]'; compute unit 'vadd_3' cannot be used with this argument and is ignored.
I do not have any issue when unrolling the loop by hanad, as mentioned above.

0 Kudos