Skip to content

Commit ff02400

Browse files
author
Anudeep Kambapu
authored
Merge pull request #15 from oneapi-src/quicksilver/fix_sycl_math_calls
[Quicksilver] Used math calls from sycl
2 parents 75f6820 + 09d1f9e commit ff02400

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

QuickSilver/SYCL/src/GridAssignmentObject.cc.dp.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ SPDX-License-Identifier: BSD-3-Clause
4141

4242
using std::queue;
4343
using std::vector;
44-
using sycl::floor;
4544
using sycl::max;
4645
using sycl::min;
4746

@@ -88,9 +87,9 @@ GridAssignmentObject::GridAssignmentObject(const vector<MC_Vector> &centers)
8887

8988
double x = _centers.size() / centersPerCell / (lx * ly * lz);
9089
x = pow(x, 1.0 / 3.0);
91-
_nx = max(1., floor(x * lx));
92-
_ny = max(1., floor(x * ly));
93-
_nz = max(1., floor(x * lz));
90+
_nx = max(1., sycl::floor(x * lx));
91+
_ny = max(1., sycl::floor(x * ly));
92+
_nz = max(1., sycl::floor(x * lz));
9493
_dx = lx / _nx;
9594
_dy = ly / _ny;
9695
_dz = lz / _nz;

QuickSilver/SYCL/src/MonteCarlo.cc.dp.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
5959
#include "macros.hh" // current location of openMP wrappers.
6060
#include "cudaUtils.hh"
6161

62-
using sycl::ceil;
63-
6462
//----------------------------------------------------------------------------------------------------------------------
6563
// Construct a MonteCarlo object.
6664
//----------------------------------------------------------------------------------------------------------------------
@@ -135,7 +133,7 @@ MonteCarlo::MonteCarlo(const Parameters &params)
135133
{
136134
const MaterialParameters &mp = matIter->second;
137135
double nuBar = params.crossSectionParams.at(mp.fissionCrossSection).nuBar;
138-
size_t nb = ceil(nuBar);
136+
size_t nb = sycl::ceil(nuBar);
139137
size_t test_size = nb * (batch_size);
140138

141139
if (test_size > vector_size)

QuickSilver/SYCL/src/NuclearData.hh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
5959
#include "EnergySpectrum.hh"
6060

6161
using std::pow;
62-
using sycl::log10;
6362

6463
#if defined(HAVE_SYCL)
6564
extern sycl::queue sycl_device_queue; // global variable for device queue
@@ -111,7 +110,7 @@ public:
111110
for (int ii = 0; ii < nGroups; ++ii)
112111
{
113112
double energy = (energies[ii] + energies[ii + 1]) / 2.0;
114-
_crossSection[ii] = sycl::pow<double>(10, polynomial(log10(energy)));
113+
_crossSection[ii] = sycl::pow(10.0, (double)polynomial(sycl::log10(energy)));
115114
}
116115

117116
// Find the normalization value for the polynomial. This is the
@@ -398,7 +397,7 @@ public:
398397
for (int ii = 0; ii < nGroups; ++ii)
399398
{
400399
double energy = (energies[ii] + energies[ii + 1]) / 2.0;
401-
_crossSection[ii] = sycl::pow<double>(10, polynomial(log10(energy)));
400+
_crossSection[ii] = sycl::pow(10.0, (double)polynomial(sycl::log10(energy)));
402401
}
403402

404403
// Find the normalization value for the polynomial. This is the

0 commit comments

Comments
 (0)