Skip to content

Commit

Permalink
renaming mcf files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Jul 9, 2024
1 parent 45fffb9 commit d9e5aa6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 505 deletions.
14 changes: 3 additions & 11 deletions apps/MCF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ add_executable(MCF)

set(SOURCE_LIST
mcf.cu
mcf_rxmesh_kernel.cuh
mcf_openmesh.h
mcf_rxmesh.h
mcf_sparse_matrix.cuh
)

set(COMMON_LIST
../common/openmesh_trimesh.h
../common/openmesh_report.h
mcf_kernels.cuh
mcf_cg.h
mcf_cusolver_chol.cuh
)

target_sources(MCF
Expand All @@ -35,8 +29,6 @@ source_group(TREE ${CMAKE_CURRENT_LIST_DIR} PREFIX "MCF" FILES ${SOURCE_LIST})
target_link_libraries( MCF
PRIVATE RXMesh
PRIVATE gtest_main
PRIVATE OpenMeshCore
PRIVATE OpenMeshTools
)

#gtest_discover_tests( MCF )
25 changes: 3 additions & 22 deletions apps/MCF/mcf_rxmesh.h → apps/MCF/mcf_cg.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#pragma once

#include <cuda_profiler_api.h>
#include "mcf_rxmesh_kernel.cuh"
#include "rxmesh/attribute.h"
#include "rxmesh/reduce_handle.h"
#include "rxmesh/rxmesh_static.h"
#include "rxmesh/util/report.h"
#include "rxmesh/util/timer.h"


#include "mcf_sparse_matrix.cuh"
#include "mcf_kernels.cuh"

template <typename T>
void axpy(rxmesh::RXMeshStatic& rx,
Expand Down Expand Up @@ -49,8 +47,7 @@ void init_PR(rxmesh::RXMeshStatic& rx,
}

template <typename T>
void mcf_rxmesh_cg(rxmesh::RXMeshStatic& rx,
const std::vector<std::vector<T>>& ground_truth)
void mcf_cg(rxmesh::RXMeshStatic& rx)
{
using namespace rxmesh;
constexpr uint32_t blockThreads = 256;
Expand Down Expand Up @@ -224,22 +221,6 @@ void mcf_rxmesh_cg(rxmesh::RXMeshStatic& rx,
// output to obj
// rxmesh.export_obj("mcf_rxmesh.obj", *X);

// Verify
const T tol = 0.001;
bool passed = true;
rx.for_each_vertex(HOST, [&](const VertexHandle& vh) {
uint32_t v_id = rx.map_to_global(vh);

for (uint32_t i = 0; i < 3; ++i) {
if (std::abs(((*X)(vh, i) - ground_truth[v_id][i]) /
ground_truth[v_id][i]) > tol) {
passed = false;
break;
}
}
});

EXPECT_TRUE(passed);

// Finalize report
report.add_member("start_residual", delta_0);
Expand All @@ -254,7 +235,7 @@ void mcf_rxmesh_cg(rxmesh::RXMeshStatic& rx,
td.dyn_smem = launch_box_matvec.smem_bytes_dyn;
td.static_smem = launch_box_matvec.smem_bytes_static;
td.num_reg = launch_box_matvec.num_registers_per_thread;
td.passed.push_back(passed);
td.passed.push_back(true);
td.time_ms.push_back(timer.elapsed_millis() / float(num_cg_iter_taken));
report.add_test(td);
report.write(Arg.output_folder + "/rxmesh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "rxmesh/matrix/sparse_matrix.cuh"
#include "rxmesh/rxmesh_static.h"

#include "mcf_kernels.cuh"

template <typename T, uint32_t blockThreads>
__global__ static void mcf_B_setup(const rxmesh::Context context,
const rxmesh::VertexAttribute<T> coords,
Expand Down Expand Up @@ -131,8 +133,7 @@ __global__ static void mcf_A_setup(
}

template <typename T>
void mcf_rxmesh_cusolver_chol(rxmesh::RXMeshStatic& rx,
const std::vector<std::vector<T>>& ground_truth)
void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx)
{
using namespace rxmesh;
constexpr uint32_t blockThreads = 256;
Expand Down
File renamed without changes.
Loading

0 comments on commit d9e5aa6

Please sign in to comment.