Skip to content

Commit

Permalink
[SYCLomatic] Fix ambiguous calling of 2 math cases.
Browse files Browse the repository at this point in the history
Signed-off-by: Tang, Jiajun jiajun.tang@intel.com
  • Loading branch information
tangjj11 committed Nov 20, 2023
1 parent 9caefcb commit c52f680
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 192 deletions.
192 changes: 96 additions & 96 deletions features/feature_case/math/math-emu-double.cu
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ void testRnorm4dCases(const vector<pair<d_tuple4, di_pair>> &TestCases) {

// Double Precision Intrinsics

__global__ void dadd_rd(float *const Result, float Input1, float Input2) {
__global__ void dadd_rd(double *const Result, double Input1, double Input2) {
*Result = __dadd_rd(Input1, Input2);
}

void testDadd_rdCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dadd_rd<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -318,13 +318,13 @@ void testDadd_rdCases(
}
}

__global__ void dadd_rn(float *const Result, float Input1, float Input2) {
__global__ void dadd_rn(double *const Result, double Input1, double Input2) {
*Result = __dadd_rn(Input1, Input2);
}

void testDadd_rnCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dadd_rn<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -334,13 +334,13 @@ void testDadd_rnCases(
}
}

__global__ void dadd_ru(float *const Result, float Input1, float Input2) {
__global__ void dadd_ru(double *const Result, double Input1, double Input2) {
*Result = __dadd_ru(Input1, Input2);
}

void testDadd_ruCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dadd_ru<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -350,13 +350,13 @@ void testDadd_ruCases(
}
}

__global__ void dadd_rz(float *const Result, float Input1, float Input2) {
__global__ void dadd_rz(double *const Result, double Input1, double Input2) {
*Result = __dadd_rz(Input1, Input2);
}

void testDadd_rzCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dadd_rz<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -366,13 +366,13 @@ void testDadd_rzCases(
}
}

__global__ void dmul_rd(float *const Result, float Input1, float Input2) {
__global__ void dmul_rd(double *const Result, double Input1, double Input2) {
*Result = __dmul_rd(Input1, Input2);
}

void testDmul_rdCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dmul_rd<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -382,13 +382,13 @@ void testDmul_rdCases(
}
}

__global__ void dmul_rn(float *const Result, float Input1, float Input2) {
__global__ void dmul_rn(double *const Result, double Input1, double Input2) {
*Result = __dmul_rn(Input1, Input2);
}

void testDmul_rnCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dmul_rn<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -398,13 +398,13 @@ void testDmul_rnCases(
}
}

__global__ void dmul_ru(float *const Result, float Input1, float Input2) {
__global__ void dmul_ru(double *const Result, double Input1, double Input2) {
*Result = __dmul_ru(Input1, Input2);
}

void testDmul_ruCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dmul_ru<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -414,13 +414,13 @@ void testDmul_ruCases(
}
}

__global__ void dmul_rz(float *const Result, float Input1, float Input2) {
__global__ void dmul_rz(double *const Result, double Input1, double Input2) {
*Result = __dmul_rz(Input1, Input2);
}

void testDmul_rzCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dmul_rz<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -430,13 +430,13 @@ void testDmul_rzCases(
}
}

__global__ void dsub_rd(float *const Result, float Input1, float Input2) {
__global__ void dsub_rd(double *const Result, double Input1, double Input2) {
*Result = __dsub_rd(Input1, Input2);
}

void testDsub_rdCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dsub_rd<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -446,13 +446,13 @@ void testDsub_rdCases(
}
}

__global__ void dsub_rn(float *const Result, float Input1, float Input2) {
__global__ void dsub_rn(double *const Result, double Input1, double Input2) {
*Result = __dsub_rn(Input1, Input2);
}

void testDsub_rnCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dsub_rn<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -462,13 +462,13 @@ void testDsub_rnCases(
}
}

__global__ void dsub_ru(float *const Result, float Input1, float Input2) {
__global__ void dsub_ru(double *const Result, double Input1, double Input2) {
*Result = __dsub_ru(Input1, Input2);
}

void testDsub_ruCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dsub_ru<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand All @@ -478,13 +478,13 @@ void testDsub_ruCases(
}
}

__global__ void dsub_rz(float *const Result, float Input1, float Input2) {
__global__ void dsub_rz(double *const Result, double Input1, double Input2) {
*Result = __dsub_rz(Input1, Input2);
}

void testDsub_rzCases(
const vector<pair<pair<float, float>, di_pair>> &TestCases) {
float *Result;
const vector<pair<pair<double, double>, di_pair>> &TestCases) {
double *Result;
cudaMallocManaged(&Result, sizeof(*Result));
for (const auto &TestCase : TestCases) {
dsub_rz<<<1, 1>>>(Result, TestCase.first.first, TestCase.first.second);
Expand Down Expand Up @@ -553,88 +553,88 @@ int main() {
{{23, 432, 23, 1}, {0.002308274913317669, 18}},
});
testDadd_rdCases({
{{-0.3, -0.4}, {-0.7000000476837158, 16}},
{{0.3, -0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.4}, {0.7000000476837158, 16}},
{{0.3, 0.8}, {1.100000023841858, 15}},
{{3, 4}, {7, 15}},
{{-0.3, -0.4}, {-0.7000000476837158, 7}},
{{0.3, -0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.4}, {0.7000000476837158, 7}},
{{0.3, 0.8}, {1.100000023841858, 7}},
{{3, 4}, {7, 7}},
});
testDadd_rnCases({
{{-0.3, -0.4}, {-0.7000000476837158, 16}},
{{0.3, -0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.4}, {0.7000000476837158, 16}},
{{0.3, 0.8}, {1.100000023841858, 15}},
{{3, 4}, {7, 15}},
{{-0.3, -0.4}, {-0.7000000476837158, 7}},
{{0.3, -0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.4}, {0.7000000476837158, 7}},
{{0.3, 0.8}, {1.100000023841858, 7}},
{{3, 4}, {7, 7}},
});
testDadd_ruCases({
{{-0.3, -0.4}, {-0.7000000476837158, 16}},
{{0.3, -0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.4}, {0.7000000476837158, 16}},
{{0.3, 0.8}, {1.100000023841858, 15}},
{{3, 4}, {7, 15}},
{{-0.3, -0.4}, {-0.7000000476837158, 7}},
{{0.3, -0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.4}, {0.7000000476837158, 7}},
{{0.3, 0.8}, {1.100000023841858, 7}},
{{3, 4}, {7, 7}},
});
testDadd_rzCases({
{{-0.3, -0.4}, {-0.7000000476837158, 16}},
{{0.3, -0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.4}, {0.7000000476837158, 16}},
{{0.3, 0.8}, {1.100000023841858, 15}},
{{3, 4}, {7, 15}},
{{-0.3, -0.4}, {-0.7000000476837158, 7}},
{{0.3, -0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.4}, {0.7000000476837158, 7}},
{{0.3, 0.8}, {1.100000023841858, 7}},
{{3, 4}, {7, 7}},
});
testDmul_rdCases({
{{-0.3, -0.4}, {0.12000000476837158, 17}},
{{0.3, -0.4}, {-0.12000000476837158, 17}},
{{0.3, 0.4}, {0.12000000476837158, 17}},
{{0.3, 0.8}, {0.2400000095367432, 16}},
{{3, 4}, {12, 15}},
{{-0.3, -0.4}, {0.12000000476837158, 7}},
{{0.3, -0.4}, {-0.12000000476837158, 7}},
{{0.3, 0.4}, {0.12000000476837158, 7}},
{{0.3, 0.8}, {0.2400000095367432, 7}},
{{3, 4}, {12, 7}},
});
testDmul_rnCases({
{{-0.3, -0.4}, {0.12000000476837158, 17}},
{{0.3, -0.4}, {-0.12000000476837158, 17}},
{{0.3, 0.4}, {0.12000000476837158, 17}},
{{0.3, 0.8}, {0.2400000095367432, 16}},
{{3, 4}, {12, 15}},
{{-0.3, -0.4}, {0.12000000476837158, 7}},
{{0.3, -0.4}, {-0.12000000476837158, 7}},
{{0.3, 0.4}, {0.12000000476837158, 7}},
{{0.3, 0.8}, {0.2400000095367432, 7}},
{{3, 4}, {12, 7}},
});
testDmul_ruCases({
{{-0.3, -0.4}, {0.12000000476837158, 17}},
{{0.3, -0.4}, {-0.12000000476837158, 17}},
{{0.3, 0.4}, {0.12000000476837158, 17}},
{{0.3, 0.8}, {0.2400000095367432, 16}},
{{3, 4}, {12, 15}},
{{-0.3, -0.4}, {0.12000000476837158, 7}},
{{0.3, -0.4}, {-0.12000000476837158, 7}},
{{0.3, 0.4}, {0.12000000476837158, 7}},
{{0.3, 0.8}, {0.2400000095367432, 7}},
{{3, 4}, {12, 7}},
});
testDmul_rzCases({
{{-0.3, -0.4}, {0.12000000476837158, 17}},
{{0.3, -0.4}, {-0.12000000476837158, 17}},
{{0.3, 0.4}, {0.12000000476837158, 17}},
{{0.3, 0.8}, {0.2400000095367432, 16}},
{{3, 4}, {12, 15}},
{{-0.3, -0.4}, {0.12000000476837158, 7}},
{{0.3, -0.4}, {-0.12000000476837158, 7}},
{{0.3, 0.4}, {0.12000000476837158, 7}},
{{0.3, 0.8}, {0.2400000095367432, 7}},
{{3, 4}, {12, 7}},
});
testDsub_rdCases({
{{-0.3, -0.4}, {0.09999999403953552, 17}},
{{0.3, -0.4}, {0.7000000476837158, 16}},
{{0.3, 0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.8}, {-0.5, 16}},
{{3, 4}, {-1, 15}},
{{-0.3, -0.4}, {0.09999999403953552, 7}},
{{0.3, -0.4}, {0.7000000476837158, 7}},
{{0.3, 0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.8}, {-0.5, 7}},
{{3, 4}, {-1, 7}},
});
testDsub_rnCases({
{{-0.3, -0.4}, {0.09999999403953552, 17}},
{{0.3, -0.4}, {0.7000000476837158, 16}},
{{0.3, 0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.8}, {-0.5, 16}},
{{3, 4}, {-1, 15}},
{{-0.3, -0.4}, {0.09999999403953552, 7}},
{{0.3, -0.4}, {0.7000000476837158, 7}},
{{0.3, 0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.8}, {-0.5, 7}},
{{3, 4}, {-1, 7}},
});
testDsub_ruCases({
{{-0.3, -0.4}, {0.09999999403953552, 17}},
{{0.3, -0.4}, {0.7000000476837158, 16}},
{{0.3, 0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.8}, {-0.5, 16}},
{{3, 4}, {-1, 15}},
{{-0.3, -0.4}, {0.09999999403953552, 7}},
{{0.3, -0.4}, {0.7000000476837158, 7}},
{{0.3, 0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.8}, {-0.5, 7}},
{{3, 4}, {-1, 7}},
});
testDsub_rzCases({
{{-0.3, -0.4}, {0.09999999403953552, 17}},
{{0.3, -0.4}, {0.7000000476837158, 16}},
{{0.3, 0.4}, {-0.09999999403953552, 17}},
{{0.3, 0.8}, {-0.5, 16}},
{{3, 4}, {-1, 15}},
{{-0.3, -0.4}, {0.09999999403953552, 7}},
{{0.3, -0.4}, {0.7000000476837158, 7}},
{{0.3, 0.4}, {-0.09999999403953552, 7}},
{{0.3, 0.8}, {-0.5, 7}},
{{3, 4}, {-1, 7}},
});
cout << "passed " << passed << "/" << passed + failed << " cases!" << endl;
if (failed) {
Expand Down
Loading

0 comments on commit c52f680

Please sign in to comment.