Skip to content

Commit a3d81c7

Browse files
[SYCL][NFC] Remove redundant argument in common_ctor_checks (#17186)
This commit removes the redundant State argument from kernel_bundle_impl::common_ctor_checks, as it always corresponds 1:1 with the MState member variable. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent cdcf1a6 commit a3d81c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sycl/source/detail/kernel_bundle_impl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class kernel_bundle_impl {
5858

5959
using SpecConstMapT = std::map<std::string, std::vector<unsigned char>>;
6060

61-
void common_ctor_checks(bundle_state State) {
61+
void common_ctor_checks() const {
6262
const bool AllDevicesInTheContext =
6363
checkAllDevicesAreInContext(MDevices, MContext);
6464
if (MDevices.empty() || !AllDevicesInTheContext)
@@ -67,12 +67,12 @@ class kernel_bundle_impl {
6767
"Not all devices are associated with the context or "
6868
"vector of devices is empty");
6969

70-
if (bundle_state::input == State &&
70+
if (bundle_state::input == MState &&
7171
!checkAllDevicesHaveAspect(MDevices, aspect::online_compiler))
7272
throw sycl::exception(make_error_code(errc::invalid),
7373
"Not all devices have aspect::online_compiler");
7474

75-
if (bundle_state::object == State &&
75+
if (bundle_state::object == MState &&
7676
!checkAllDevicesHaveAspect(MDevices, aspect::online_linker))
7777
throw sycl::exception(make_error_code(errc::invalid),
7878
"Not all devices have aspect::online_linker");
@@ -82,7 +82,7 @@ class kernel_bundle_impl {
8282
kernel_bundle_impl(context Ctx, std::vector<device> Devs, bundle_state State)
8383
: MContext(std::move(Ctx)), MDevices(std::move(Devs)), MState(State) {
8484

85-
common_ctor_checks(State);
85+
common_ctor_checks();
8686

8787
MDeviceImages = detail::ProgramManager::getInstance().getSYCLDeviceImages(
8888
MContext, MDevices, State);
@@ -267,7 +267,7 @@ class kernel_bundle_impl {
267267
bundle_state State)
268268
: MContext(std::move(Ctx)), MDevices(std::move(Devs)), MState(State) {
269269

270-
common_ctor_checks(State);
270+
common_ctor_checks();
271271

272272
MDeviceImages = detail::ProgramManager::getInstance().getSYCLDeviceImages(
273273
MContext, MDevices, KernelIDs, State);
@@ -278,7 +278,7 @@ class kernel_bundle_impl {
278278
const DevImgSelectorImpl &Selector, bundle_state State)
279279
: MContext(std::move(Ctx)), MDevices(std::move(Devs)), MState(State) {
280280

281-
common_ctor_checks(State);
281+
common_ctor_checks();
282282

283283
MDeviceImages = detail::ProgramManager::getInstance().getSYCLDeviceImages(
284284
MContext, MDevices, Selector, State);

0 commit comments

Comments
 (0)