You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a code (usually in tensor) that depends on a specific compilation to work (i.e hardware), we should encapsulate it with its corresponding preprocessing directive.
The reason behind this is that Tensor::isCPU/isGPU/isFPGA() relies on the Tensor->device value which can be set by the user and lead to errors hard to debug.
Example:
if (A->isCPU()) { // CPU
// Do stuff
}
#ifdef cGPU
else if (A->isGPU()){ // GPU
// Do stuff
}
#endif
#ifdef cFPGA
else if (A->isFPGA()) { // FPGA
// do stuff
}
#endif
The text was updated successfully, but these errors were encountered:
Add preprocessor directives for FPGA
If we have a code (usually in tensor) that depends on a specific compilation to work (i.e hardware), we should encapsulate it with its corresponding preprocessing directive.
The reason behind this is that
Tensor::isCPU/isGPU/isFPGA()
relies on theTensor->device
value which can be set by the user and lead to errors hard to debug.Example:
The text was updated successfully, but these errors were encountered: