Skip to content

Commit

Permalink
Merge branch 'windows' into cuda9
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausT committed Jan 28, 2018
2 parents 911f046 + c198b7c commit e9f33a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ neoscrypt/cuda_neoscrypt.o: neoscrypt/cuda_neoscrypt.cu
$(NVCC) -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_37,code=sm_37 -gencode=arch=compute_70,code=sm_70 @CUDA_INCLUDES@ -I. @CUDA_CFLAGS@ --ptxas-options="-v" -o $@ -c $<

neoscrypt/cuda_neoscrypt_tpruvot.o: neoscrypt/cuda_neoscrypt_tpruvot.cu
$(NVCC) -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 @CUDA_INCLUDES@ -I. @CUDA_CFLAGS@ --ptxas-options="-v" -o $@ -c $<
$(NVCC) -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 @CUDA_INCLUDES@ -I. $(JANSSON_INCLUDES) @CUDA_CFLAGS@ --ptxas-options="-v" -o $@ -c $<
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

#--ptxas-options=\"-v -dlcm=cg\""

extracflags="-march=native -std=c++11 -D_REENTRANT -falign-functions=16 -falign-jumps=16 -falign-labels=16 -fno-strict-aliasing"
extracflags="-march=native -std=c++11 -pthread -fno-strict-aliasing"

CUDA_CFLAGS="-O3 -std=c++11 -Xcompiler -fno-strict-aliasing,-Wall -D_FORCE_INLINES" ./configure CXXFLAGS="-O3 $extracflags" --with-cuda=/usr/local/cuda --with-nvml=libnvidia-ml.so
17 changes: 13 additions & 4 deletions sysinfos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,27 @@ static double linux_cputemp(int core)
return tc;
}

#define CPUFREQ_PATH \
"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq"
static uint32_t linux_cpufreq(int core)
{
FILE *fd = fopen(CPUFREQ_PATH, "r");
uint32_t freq = 0;
FILE *fd;

if(!fd)
fd = fopen("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", "r");
if(fd != NULL)
{
fscanf(fd, "%d", &freq);
fclose(fd);
}
else // sometimes we don't have read permission for cpuinfo_cur_freq
{
fd = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
if(fd != NULL)
{
fscanf(fd, "%d", &freq);
fclose(fd);
}

}
return freq;
}

Expand Down

0 comments on commit e9f33a4

Please sign in to comment.