Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCLomatic] Fix malloc memory size bug of math half2 tests. #732

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions features/feature_case/math/math-emu-half2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void testHle2(float *const Result, __half2 Input1, __half2 Input2) {

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

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

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

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

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

void testHneu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
float *Result;
cudaMallocManaged(&Result, sizeof(*Result));
cudaMallocManaged(&Result, 2 * sizeof(*Result));
for (const auto &TestCase : TestCases) {
testHneu2(Result, TestCase.first.first, TestCase.first.second);
checkResult("__hneu2", {TestCase.first.first, TestCase.first.second},
Expand Down
12 changes: 6 additions & 6 deletions features/feature_case/math/math-ext-half2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ void testHle2(float *const Result, __half2 Input1, __half2 Input2) {

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

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

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

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

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

void testHneu2Cases(const vector<pair<half2_pair, h2i_pair>> &TestCases) {
float *Result;
cudaMallocManaged(&Result, sizeof(*Result));
cudaMallocManaged(&Result, 2 * sizeof(*Result));
for (const auto &TestCase : TestCases) {
testHneu2(Result, TestCase.first.first, TestCase.first.second);
checkResult("__hneu2", {TestCase.first.first, TestCase.first.second},
Expand Down
Loading