Skip to content

Commit 648a17b

Browse files
authored
[SYCLomatic] Fix malloc memory size bug of math half2 tests. (#732)
Signed-off-by: Tang, Jiajun [email protected]
1 parent 2433809 commit 648a17b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

features/feature_case/math/math-emu-half2.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ void testHle2(float *const Result, __half2 Input1, __half2 Input2) {
562562

563563
void testHle2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
564564
float *Result;
565-
cudaMallocManaged(&Result, sizeof(*Result));
565+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
566566
for (const auto &TestCase : TestCases) {
567567
testHle2(Result, TestCase.first.first, TestCase.first.second);
568568
checkResult("__hle2", {TestCase.first.first, TestCase.first.second},
@@ -584,7 +584,7 @@ void testHleu2(float *const Result, __half2 Input1, __half2 Input2) {
584584

585585
void testHleu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
586586
float *Result;
587-
cudaMallocManaged(&Result, sizeof(*Result));
587+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
588588
for (const auto &TestCase : TestCases) {
589589
testHleu2(Result, TestCase.first.first, TestCase.first.second);
590590
checkResult("__hleu2", {TestCase.first.first, TestCase.first.second},
@@ -606,7 +606,7 @@ void testHlt2(float *const Result, __half2 Input1, __half2 Input2) {
606606

607607
void testHlt2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
608608
float *Result;
609-
cudaMallocManaged(&Result, sizeof(*Result));
609+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
610610
for (const auto &TestCase : TestCases) {
611611
testHlt2(Result, TestCase.first.first, TestCase.first.second);
612612
checkResult("__hlt2", {TestCase.first.first, TestCase.first.second},
@@ -628,7 +628,7 @@ void testHltu2(float *const Result, __half2 Input1, __half2 Input2) {
628628

629629
void testHltu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
630630
float *Result;
631-
cudaMallocManaged(&Result, sizeof(*Result));
631+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
632632
for (const auto &TestCase : TestCases) {
633633
testHltu2(Result, TestCase.first.first, TestCase.first.second);
634634
checkResult("__hltu2", {TestCase.first.first, TestCase.first.second},
@@ -650,7 +650,7 @@ void testHne2(float *const Result, __half2 Input1, __half2 Input2) {
650650

651651
void testHne2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
652652
float *Result;
653-
cudaMallocManaged(&Result, sizeof(*Result));
653+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
654654
for (const auto &TestCase : TestCases) {
655655
testHne2(Result, TestCase.first.first, TestCase.first.second);
656656
checkResult("__hne2", {TestCase.first.first, TestCase.first.second},
@@ -672,7 +672,7 @@ void testHneu2(float *const Result, __half2 Input1, __half2 Input2) {
672672

673673
void testHneu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
674674
float *Result;
675-
cudaMallocManaged(&Result, sizeof(*Result));
675+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
676676
for (const auto &TestCase : TestCases) {
677677
testHneu2(Result, TestCase.first.first, TestCase.first.second);
678678
checkResult("__hneu2", {TestCase.first.first, TestCase.first.second},

features/feature_case/math/math-ext-half2.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ void testHle2(float *const Result, __half2 Input1, __half2 Input2) {
561561

562562
void testHle2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
563563
float *Result;
564-
cudaMallocManaged(&Result, sizeof(*Result));
564+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
565565
for (const auto &TestCase : TestCases) {
566566
testHle2(Result, TestCase.first.first, TestCase.first.second);
567567
checkResult("__hle2", {TestCase.first.first, TestCase.first.second},
@@ -583,7 +583,7 @@ void testHleu2(float *const Result, __half2 Input1, __half2 Input2) {
583583

584584
void testHleu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
585585
float *Result;
586-
cudaMallocManaged(&Result, sizeof(*Result));
586+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
587587
for (const auto &TestCase : TestCases) {
588588
testHleu2(Result, TestCase.first.first, TestCase.first.second);
589589
checkResult("__hleu2", {TestCase.first.first, TestCase.first.second},
@@ -605,7 +605,7 @@ void testHlt2(float *const Result, __half2 Input1, __half2 Input2) {
605605

606606
void testHlt2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
607607
float *Result;
608-
cudaMallocManaged(&Result, sizeof(*Result));
608+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
609609
for (const auto &TestCase : TestCases) {
610610
testHlt2(Result, TestCase.first.first, TestCase.first.second);
611611
checkResult("__hlt2", {TestCase.first.first, TestCase.first.second},
@@ -627,7 +627,7 @@ void testHltu2(float *const Result, __half2 Input1, __half2 Input2) {
627627

628628
void testHltu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
629629
float *Result;
630-
cudaMallocManaged(&Result, sizeof(*Result));
630+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
631631
for (const auto &TestCase : TestCases) {
632632
testHltu2(Result, TestCase.first.first, TestCase.first.second);
633633
checkResult("__hltu2", {TestCase.first.first, TestCase.first.second},
@@ -649,7 +649,7 @@ void testHne2(float *const Result, __half2 Input1, __half2 Input2) {
649649

650650
void testHne2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
651651
float *Result;
652-
cudaMallocManaged(&Result, sizeof(*Result));
652+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
653653
for (const auto &TestCase : TestCases) {
654654
testHne2(Result, TestCase.first.first, TestCase.first.second);
655655
checkResult("__hne2", {TestCase.first.first, TestCase.first.second},
@@ -671,7 +671,7 @@ void testHneu2(float *const Result, __half2 Input1, __half2 Input2) {
671671

672672
void testHneu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
673673
float *Result;
674-
cudaMallocManaged(&Result, sizeof(*Result));
674+
cudaMallocManaged(&Result, 2 * sizeof(*Result));
675675
for (const auto &TestCase : TestCases) {
676676
testHneu2(Result, TestCase.first.first, TestCase.first.second);
677677
checkResult("__hneu2", {TestCase.first.first, TestCase.first.second},

0 commit comments

Comments
 (0)