Skip to content

Commit e31ff53

Browse files
authored
[SYCL] Fix memory leaks. (#17234)
Adding missing `sycl::free` calls to sycl/test-e2e/DeviceLib/built-ins/offload-prec-div-sqrt.cpp.
1 parent ab3f61a commit e31ff53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sycl/test-e2e/DeviceLib/built-ins/offload-prec-div-sqrt.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ void test_div() {
2929
int ulpDist = std::abs(sycl::bit_cast<int32_t>(hostRef) -
3030
sycl::bit_cast<int32_t>(*output));
3131
assert(ulpDist == 0 && "Division is not precise");
32+
sycl::free(inValue, q);
33+
sycl::free(inDivider, q);
34+
sycl::free(output, q);
3235
}
3336

3437
void test_sqrt() {
@@ -47,6 +50,8 @@ void test_sqrt() {
4750
int ulpDist = std::abs(sycl::bit_cast<int32_t>(hostRef) -
4851
sycl::bit_cast<int32_t>(*output));
4952
assert(ulpDist == 0 && "Sqrt is not precise");
53+
sycl::free(inValue, q);
54+
sycl::free(output, q);
5055
}
5156

5257
int main() {

0 commit comments

Comments
 (0)