Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preprocessor directives for FPGA #325

Open
salvacarrion opened this issue Dec 15, 2021 · 0 comments
Open

Add preprocessor directives for FPGA #325

salvacarrion opened this issue Dec 15, 2021 · 0 comments
Assignees

Comments

@salvacarrion
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants