Skip to content

Commit

Permalink
bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
aghaeifar committed Aug 6, 2024
1 parent 8213bad commit 5de313c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/helper.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <boost/log/trivial.hpp>
#include "helper_cuda.h"

#define ERR_MSG "\033[1;31mError:\033[0m "
//---------------------------------------------------------------------------------------------
// check for CUDA and GPU device
//---------------------------------------------------------------------------------------------
Expand All @@ -17,8 +16,7 @@ bool check_CUDA()
cudaError_t error = cudaGetDeviceCount(&device);
if (error != cudaSuccess)
{
std::cout << ERR_MSG << "GPU does not present or driver version does not match CUDA version. Aborting...!\n";
std::cout << "CUDA error: " << cudaGetErrorString(error) << "\n";
std::cout << "\033[1;31mError:\033[0m " <<cudaGetErrorString(error) << "\n";
return false;
}
return true;
Expand Down Expand Up @@ -65,7 +63,7 @@ bool check_memory_size(size_t required_size_MB)
{
if (check_CUDA() == false)
return false;

size_t free, total;
bool memory_ok = true;
int32_t device_count = getDeviceCount();
Expand Down
3 changes: 2 additions & 1 deletion src/spinwalk.cu
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#endif

#define BLOCKS 256
#define ERR_MSG "\033[1;31mError:\033[0m "

namespace bl = boost::log;
using namespace indicators;
Expand Down Expand Up @@ -362,7 +363,7 @@ int main(int argc, char * argv[])
#ifdef __CUDACC__
if (subcommand_sim->count("--use_cpu") == 0)
if(check_CUDA() == false)
return 1;
return 0;
#endif

std::cout << "Running simulation for " << config_files.size() << " config(s)..." << "\n\n";
Expand Down
5 changes: 3 additions & 2 deletions tests/test_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ pushd "$SCRIPT_DIR" > /dev/null

docker system prune -a --volumes --force

rm -rf "./build"

rm -rf "../build"
echo "Building GPU Docker image..."
docker build --no-cache -f ../Dockerfile -t spinwalk_gpu ..

rm -rf "./build"

rm -rf "../build"
echo "Building CPU Docker image..."
docker build --no-cache -f ../Dockerfile_CPU -t spinwalk_cpu ..

0 comments on commit 5de313c

Please sign in to comment.