Skip to content

Commit

Permalink
Adapt interface to KMM 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
isazi committed Nov 27, 2024
1 parent 27254cc commit c4bcb8f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions include/compas/core/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ template<typename T, size_t N = 1>
using host_view_mut = kmm::view_mut<T, N>;

template<typename T, size_t N = 1>
using cuda_view = kmm::cuda_view<T, N>;
using gpu_view = kmm::gpu_view<T, N>;

template<typename T, size_t N = 1>
using cuda_view_mut = kmm::cuda_view_mut<T, N>;
using gpu_view_mut = kmm::gpu_view_mut<T, N>;

template<typename T, size_t N = 1>
using cuda_subview_mut = kmm::cuda_subview_mut<T, N>;
using gpu_subview_mut = kmm::gpu_subview_mut<T, N>;

template<typename T, size_t N = 1>
using cuda_strided_view = kmm::cuda_strided_view<T, N>;
using gpu_strided_view = kmm::gpu_strided_view<T, N>;

template<typename T, size_t N = 1>
using cuda_strided_view_mut = kmm::cuda_strided_view_mut<T, N>;
using gpu_strided_view_mut = kmm::gpu_strided_view_mut<T, N>;

} // namespace compas
2 changes: 1 addition & 1 deletion include/compas/parameters/tissue_view.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct TissueVoxel {
* Device-side representation of `TissueParameters`
*/
struct TissueParametersView {
cuda_view<float, 2> parameters;
gpu_view<float, 2> parameters;
int nvoxels;
bool has_z;
bool has_b0;
Expand Down
4 changes: 2 additions & 2 deletions include/compas/sequences/fisp_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace compas {
struct FISPSequenceView {
// Vector with flip angle for each TR with abs.(RF_train) the RF flip angles in degrees and
// angle.(RF_train) should be the RF phases in degrees.
cuda_view<cfloat> RF_train;
gpu_view<cfloat> RF_train;

// Matrix with RF scaling factors (a.u.) to simulate slice profile effects.
// Each column represents the (flip angle dependent) scaling factors for one position along the slice direction.
cuda_view<cfloat, 2> sliceprofiles;
gpu_view<cfloat, 2> sliceprofiles;

// Repetition time in seconds, assumed constant during the sequence
float TR;
Expand Down
6 changes: 3 additions & 3 deletions include/compas/sequences/pssfp_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ struct pSSFPSequenceView {

// Vector with flip angle for each TR with abs.(RF_train) the RF flip angles in degrees and
// angle.(RF_train) should be the RF phases in degrees.
cuda_view<cfloat> RF_train;
gpu_view<cfloat> RF_train;

// Repetition time in seconds, assumed constant during the sequence
float TR;

// Time-discretized RF waveform, normalized to flip angle of 1 degree
cuda_view<cfloat> gamma_dt_RF;
gpu_view<cfloat> gamma_dt_RF;

// Time intervals
RepetitionData dt; // Δt
RepetitionData gamma_dt_GRz; // γΔtGRz

// Vector with different positions along the slice direction.
cuda_view<float> z;
gpu_view<float> z;
};
} // namespace compas
2 changes: 1 addition & 1 deletion include/compas/simulate/fisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Array<cfloat, 2> simulate_magnetization(

void simulate_magnetization_kernel(
const kmm::DeviceContext& context,
cuda_view_mut<cfloat, 2> echos,
gpu_view_mut<cfloat, 2> echos,
TissueParametersView parameters,
FISPSequenceView sequence);

Expand Down
2 changes: 1 addition & 1 deletion include/compas/simulate/pssfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Array<cfloat, 2> simulate_magnetization(

void simulate_magnetization_kernel(
const kmm::DeviceContext& context,
cuda_view_mut<cfloat, 2> echos,
gpu_view_mut<cfloat, 2> echos,
TissueParametersView parameters,
pSSFPSequenceView sequence);
} // namespace compas
2 changes: 1 addition & 1 deletion include/compas/trajectories/cartesian_view.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct CartesianTrajectoryView {
int nreadouts;
int samples_per_readout;
float delta_t;
cuda_view<cfloat> k_start;
gpu_view<cfloat> k_start;
cfloat delta_k;

/**
Expand Down
4 changes: 2 additions & 2 deletions include/compas/trajectories/spiral_view.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ struct SpiralTrajectoryView {
int nreadouts;
int samples_per_readout;
float delta_t;
cuda_view<cfloat> k_start;
cuda_view<cfloat> delta_k;
gpu_view<cfloat> k_start;
gpu_view<cfloat> delta_k;

COMPAS_DEVICE
cfloat to_sample_point_factor(index_t readout_idx, cfloat m, TissueVoxel p) const {
Expand Down

0 comments on commit c4bcb8f

Please sign in to comment.