Skip to content

Commit b6f383b

Browse files
authored
[SYCL] Refactor CG to return const reference in getter methods (#17921)
1 parent ddb5a66 commit b6f383b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sycl/source/detail/cg.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ class CGExecKernel : public CG {
292292

293293
CGExecKernel(const CGExecKernel &CGExec) = default;
294294

295-
std::vector<ArgDesc> getArguments() const { return MArgs; }
296-
std::string getKernelName() const { return MKernelName; }
297-
std::vector<std::shared_ptr<detail::stream_impl>> getStreams() const {
295+
const std::vector<ArgDesc> &getArguments() const { return MArgs; }
296+
const std::string &getKernelName() const { return MKernelName; }
297+
const std::vector<std::shared_ptr<detail::stream_impl>> &getStreams() const {
298298
return MStreams;
299299
}
300300

@@ -304,7 +304,7 @@ class CGExecKernel : public CG {
304304
}
305305
void clearAuxiliaryResources() override { MAuxiliaryResources.clear(); }
306306

307-
std::shared_ptr<detail::kernel_bundle_impl> getKernelBundle() {
307+
const std::shared_ptr<detail::kernel_bundle_impl> &getKernelBundle() {
308308
return MKernelBundle;
309309
}
310310

@@ -530,7 +530,7 @@ class CGReadWriteHostPipe : public CG {
530530
PipeName(Name), Blocking(Block), HostPtr(Ptr), TypeSize(Size),
531531
IsReadOp(Read) {}
532532

533-
std::string getPipeName() { return PipeName; }
533+
const std::string &getPipeName() { return PipeName; }
534534
void *getHostPtr() { return HostPtr; }
535535
size_t getTypeSize() { return TypeSize; }
536536
bool isBlocking() { return Blocking; }

0 commit comments

Comments
 (0)