Skip to content

Add preprocessor directives for FPGA #325

Open
@salvacarrion

Description

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 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

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions