Skip to content

Commit 69fb2d1

Browse files
authored
Add hwctx ctors for default access mode (#9717)
Per request default access mode to shared for elf ctors just like was done for xclbin ctors. Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
1 parent 5ee0470 commit 69fb2d1

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/runtime_src/core/include/xrt/xrt_hw_context.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ class hw_context : public detail::pimpl<hw_context_impl>
105105
XRT_API_EXPORT
106106
hw_context(const xrt::device& device, const cfg_param_type& cfg_param, access_mode mode);
107107

108+
/**
109+
* hw_context() - Constructor for default shared access mode
110+
*/
111+
hw_context(const xrt::device& device, const cfg_param_type& cfg_param)
112+
: hw_context{device, cfg_param, access_mode::shared}
113+
{}
114+
108115
/**
109116
* hw_context() - Constructor with Experimental configuration type and access control
110117
*
@@ -124,6 +131,13 @@ class hw_context : public detail::pimpl<hw_context_impl>
124131
hw_context(const xrt::device& device, const cfg_type& cfg, access_mode mode);
125132

126133
/**
134+
* hw_context() - Constructor for default shared access mode
135+
*/
136+
hw_context(const xrt::device& device, const cfg_type& cfg)
137+
: hw_context{device, cfg, access_mode::shared}
138+
{}
139+
140+
/**
127141
* hw_context() - Constructor with Elf file
128142
*
129143
* @param device
@@ -143,6 +157,13 @@ class hw_context : public detail::pimpl<hw_context_impl>
143157
hw_context(const xrt::device& device, const xrt::elf& elf,
144158
const cfg_param_type& cfg_param, access_mode mode);
145159

160+
/**
161+
* hw_context() - Constructor for default shared access mode
162+
*/
163+
hw_context(const xrt::device& device, const xrt::elf& elf, const cfg_param_type& cfg_param)
164+
: hw_context{device, elf, cfg_param, access_mode::shared}
165+
{}
166+
146167
/**
147168
* hw_context() - Constructor with Elf file and Experimental configuration type
148169
*
@@ -162,6 +183,12 @@ class hw_context : public detail::pimpl<hw_context_impl>
162183
hw_context(const xrt::device& device, const xrt::elf& elf,
163184
const cfg_type& cfg, access_mode mode);
164185

186+
/**
187+
* hw_context() - Constructor for default shared access mode
188+
*/
189+
hw_context(const xrt::device& device, const xrt::elf& elf, const cfg_type& cfg)
190+
: hw_context{device, elf, cfg, access_mode::shared}
191+
{}
165192

166193
/**
167194
* hw_context() - Constructor with Elf file with implied qos and mode

0 commit comments

Comments
 (0)