Skip to content

Commit

Permalink
something is wrong in test_evaluator, it produces nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
hamsteri15 committed Jun 18, 2024
1 parent 463f3ac commit ed47f65
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ GpuKernelEvaluator::computeYNew(
std::tuple<std::vector<gScalar>, std::vector<gScalar>, gScalar>
GpuKernelEvaluator::computeRR(gScalar deltaT,
gScalar deltaTChemMax,
const std::vector<gScalar> rho,
const std::vector<gScalar> deltaTChem,
const std::vector<gScalar> Y) {
const std::vector<gScalar>& rho,
const std::vector<gScalar>& deltaTChem,
const std::vector<gScalar>& Y) {

const gLabel nCells = rho.size();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct thermosAndReactions {

thermosAndReactions() = default;

thermosAndReactions(const std::vector<gpuThermo> thermos,
thermosAndReactions(const std::vector<gpuThermo>& thermos,
const std::vector<gpuReaction>& reactions);

~thermosAndReactions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static inline T* allocateAndTransfer(const std::vector<T>& t) {
}

thermosAndReactions::thermosAndReactions(
const std::vector<gpuThermo> thermos,
const std::vector<gpuThermo>& thermos,
const std::vector<gpuReaction>& reactions)
: nThermos_(gLabel(thermos.size()))
, nReactions_(gLabel(reactions.size()))
Expand Down
16 changes: 8 additions & 8 deletions gpu_chemistry/unittest/gpuTestKernels/gpu_test_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ bool test_for_each_index(){



/*

bool test_evaluator(gLabel nCells){

using namespace FoamGpu;
Expand Down Expand Up @@ -704,26 +704,26 @@ bool test_evaluator(gLabel nCells){
);

auto newY = std::get<0>(tuple);
auto newDeltaTs = std::get<0>(tuple);
auto newDeltaTs = std::get<1>(tuple);


for (gLabel i = 0; i < nEqns; ++i){
std::cout << newY[i] << std::endl;
}

/*
auto s2 = make_mdspan(newY, extents<2>{nCells, nEqns});
for (gLabel i = 0; i < nEqns; ++i){
std::cout << s2(0, i) << std::endl;
}
*/

return newY[0] != 0;


//return true;
}
*/



}
Expand Down
9 changes: 5 additions & 4 deletions gpu_chemistry/unittest/tests/Test-gpuChemistry.C
Original file line number Diff line number Diff line change
Expand Up @@ -845,11 +845,12 @@ TEST_CASE("for_each_index (on GPU)", "[GPU]"){
CHECK(GpuTestKernels::test_for_each_index() == true);

}

/*
TEST_CASE("Test gpuKernelEvaluator"){
TEST_CASE("Test gpuKernelEvaluator (on GPU)", "[GPU]"){
CHECK(TestData::test_evaluator(1) == true);
CHECK(TestData::test_evaluator(2) == true);
CHECK(GpuTestKernels::test_evaluator(1) == true);
CHECK(GpuTestKernels::test_evaluator(2) == true);
}
*/
*/

0 comments on commit ed47f65

Please sign in to comment.