-
Notifications
You must be signed in to change notification settings - Fork 769
[WIP][SYCL][FPGA] Runtime implementation for host_pipes #5851
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
Conversation
To align with spec: intel#5838 Host pipe is a FIFO construct that provide links between elements of design that are accessed through read/write API. Host pipe is a pipe that links device kernel with host program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting
bool IsReadOp; | ||
|
||
public: | ||
CGReadWriteHostPipe(std::string Name, bool Block, void *Ptr, size_t Size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a lot of parameters could be const&
.
std::vector<Requirement *> Requirements, | ||
std::vector<detail::EventImplPtr> Events, | ||
detail::code_location loc = {}) | ||
: CG(ReadWriteHostPipe, std::move(ArgsStorage), std::move(AccStorage), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure this is the best way to accept movable stuff.
@@ -2663,6 +2672,16 @@ class __SYCL_EXPORT handler { | |||
/// The list of valid SYCL events that need to complete | |||
/// before barrier command can be executed | |||
std::vector<detail::EventImplPtr> MEventsWaitWithBarrier; | |||
/// Host pipe name | |||
std::string HostPipeName; | |||
/// Host pipe host pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to have comments!
But they could be more precise than just reading the variable name. I have no idea about what is the host pointer.
private: | ||
static constexpr int32_t m_Size = sizeof(_dataT); | ||
static constexpr int32_t m_Alignment = alignof(_dataT); | ||
static constexpr int32_t ID = _name::id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the programmer use a
#define ID 42
?
@@ -7577,6 +7577,62 @@ pi_result piextUSMGetMemAllocInfo(pi_context Context, const void *Ptr, | |||
return PI_SUCCESS; | |||
} | |||
|
|||
/// Host Pips |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipes?
/// @param blocking indicate if the read and write operations are blocking or | ||
/// non-blocking | ||
/// @param ptr a pointer to buffer in host memory where data is to be read into | ||
/// or written from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From which perspective?
#endif | ||
host_pipe { // TODO change name to pipe, and merge into the existing pipe | ||
// implementation | ||
static_assert( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a type trait instead
// TODO: Get pipe name from template, get host pointer by quering the host | ||
// pipe registration / host pipe mapping | ||
_dataT data; | ||
const std::string pipe_name = std::to_string(ID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to _get_built_in_pipe_id
RT::PiProgram Program = | ||
sycl::detail::ProgramManager::getInstance().getBuiltPIProgram( | ||
M, Queue->getContextImplPtr(), Queue->getDeviceImplPtr(), KernelName); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only need get the program base on the pipe type, require frontend to provide the info. No need for kernel name
|
||
return enqueueReadWriteHostPipe(MQueue, "ReadWriteHostPipeKernelName", | ||
pipeName, blocking, hostPtr, typeSize, | ||
RawEvents, Event, read); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to depend on the previous events in this command group? Do we care about data dependency?
Setup lower runtime extension functions for host pipes. See also intel#5766 intel#5851 Host pipe sycl spec: intel#5838
closing because superseded by #5894 |
Setup lower runtime extension functions for host pipes. See also intel#5766 intel#5851 Host pipe sycl spec: intel#5838
Setup lower runtime extension functions for host pipes. See also intel#5766 intel#5851 Host pipe sycl spec: intel#5838 (cherry picked from commit e4d513c) Zibai fixed the conflict.
Setup lower runtime extension functions for host pipes. See also intel#5766 intel#5851 Host pipe sycl spec: intel#5838 (cherry picked from commit e4d513c) Zibai fixed the conflict.
To align with spec: #5838
Host pipe is a FIFO construct that provide links between elements of design that are accessed through read/write API. Host pipe is a pipe that links device kernel with host program.