Skip to content

Commit f5c33b1

Browse files
authored
[SYCL][e2e] Fix buffer.cpp test (#20785)
Vector after reserve without resize has still size 0, and accessing its memory beyond size is undefined behavior. The test failed on integrated gpu (l0v2 adapter, ARL cpu), this PR fixes it. Signed-off-by: Mateusz P. Nowak <[email protected]>
1 parent 894db96 commit f5c33b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sycl/test-e2e/Basic/buffer/buffer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ int main() {
515515
std::vector<bool> bool_vector;
516516
std::vector<int> int_vector;
517517
std::vector<float> float_vector;
518-
bool_vector.reserve(size);
519-
int_vector.reserve(size);
520-
float_vector.reserve(size);
518+
bool_vector.resize(size);
519+
int_vector.resize(size);
520+
float_vector.resize(size);
521521

522522
sycl::queue Queue;
523523
std::mutex m;

0 commit comments

Comments
 (0)