Skip to content

Commit

Permalink
logo
Browse files Browse the repository at this point in the history
  • Loading branch information
aghaeifar committed Mar 10, 2024
1 parent fa998f4 commit 20509b7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/file_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <algorithm>
#include <iterator>
#include "ini.h"
#include "miscellaneous.h"

namespace file_utils
{
Expand Down
8 changes: 4 additions & 4 deletions src/kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ __device__ __forceinline__ void dephase_relax(float *m0, float *m1, float accumu

__global__ void cu_sim(const simulation_parameters *param, const float *pFieldMap, const uint8_t *pMask, const float *M0, const float *XYZ0, float *M1, float *XYZ1)
{
uint32_t spin_no = blockIdx.x * blockDim.x + threadIdx.x ;
auto spin_no = blockIdx.x * blockDim.x + threadIdx.x ;
if (spin_no >= param->n_spins)
return;

Expand Down Expand Up @@ -181,13 +181,13 @@ __global__ void cu_scalePos(float *scaled_xyz, float *initial_xyz, float scale,
//---------------------------------------------------------------------------------------------
__global__ void cu_scaleArray(float *array, float scale, uint64_t size)
{
uint64_t n = blockIdx.x * blockDim.x + threadIdx.x ;
auto n = blockIdx.x * blockDim.x + threadIdx.x ;
if(n < size)
array[n] *= scale;
}

//---------------------------------------------------------------------------------------------
// generate random initial position
// CUDA kernel to generate random initial position
//---------------------------------------------------------------------------------------------

__global__ void cu_randPosGen(float *spin_position_xyz, simulation_parameters *param, const uint8_t *pMask, uint32_t spin_no)
Expand Down Expand Up @@ -215,7 +215,7 @@ __global__ void cu_randPosGen(float *spin_position_xyz, simulation_parameters *p
}

//---------------------------------------------------------------------------------------------
//
// check for CUDA and GPU device
//---------------------------------------------------------------------------------------------
void print_device_info()
{
Expand Down
10 changes: 10 additions & 0 deletions src/miscellaneous.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,15 @@ typedef struct simulation_parameters
} simulation_parameters;


inline void print_logo()
{
std::cout << " \n"
" ____ _ __ __ _ _ \n"
"/ ___| _ __ (_) _ __ \\ \\ / / __ _ | | | | __ \n"
"\\___ \\ | '_ \\ | | | '_ \\ \\ \\ /\\ / / / _` | | | | |/ / \n"
" ___) | | |_) | | | | | | | \\ V V / | (_| | | | | < \n"
"|____/ | .__/ |_| |_| |_| \\_/\\_/ \\__,_| |_| |_|\\_\\ \n"
" |_| \n\n";
}

#endif // __MISCELLANEOUS_H__
1 change: 1 addition & 0 deletions src/spinwalk.cu
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ bool simulate(simulation_parameters param, std::map<std::string, std::vector<std

int main(int argc, char * argv[])
{
print_logo();
std::cout << "SpinWalk ver. " << SPINWALK_VERSION_MAJOR << "." << SPINWALK_VERSION_MINOR << "." << SPINWALK_VERSION_PATCH << std::endl;
// ========== parse command line arguments ==========
std::vector<std::string> config_files;
Expand Down

0 comments on commit 20509b7

Please sign in to comment.