Skip to content

[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

Closed
wants to merge 1 commit into from

Conversation

sherry-yuan
Copy link
Contributor

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.

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.
Copy link
Contributor

@keryell keryell left a 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,
Copy link
Contributor

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),
Copy link
Contributor

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
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From which perspective?

@sherry-yuan sherry-yuan changed the title [SYCL][FPGA] Runtime implementation for host_pipes [WIP][SYCL][FPGA] Runtime implementation for host_pipes Mar 22, 2022
#endif
host_pipe { // TODO change name to pipe, and merge into the existing pipe
// implementation
static_assert(
Copy link
Contributor Author

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);
Copy link
Contributor Author

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

Comment on lines +2129 to +2132
RT::PiProgram Program =
sycl::detail::ProgramManager::getInstance().getBuiltPIProgram(
M, Queue->getContextImplPtr(), Queue->getDeviceImplPtr(), KernelName);

Copy link
Contributor Author

@sherry-yuan sherry-yuan Mar 22, 2022

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);
Copy link
Contributor Author

@sherry-yuan sherry-yuan Mar 22, 2022

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?

sherry-yuan added a commit to sherry-yuan/llvm that referenced this pull request Mar 25, 2022
Setup lower runtime extension functions for host pipes.

See also
intel#5766
intel#5851

Host pipe sycl spec: intel#5838
@sherry-yuan
Copy link
Contributor Author

closing because superseded by #5894

@sherry-yuan sherry-yuan closed this Apr 6, 2022
sherry-yuan added a commit to sherry-yuan/llvm that referenced this pull request Apr 21, 2022
Setup lower runtime extension functions for host pipes.

See also
intel#5766
intel#5851

Host pipe sycl spec: intel#5838
rho180 pushed a commit to zibaiwan/llvm that referenced this pull request Feb 24, 2023
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.
zibaiwan pushed a commit to zibaiwan/llvm that referenced this pull request Mar 14, 2023
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.
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

Successfully merging this pull request may close these issues.

2 participants