include some requested modifications

pull/2394/head
Stefano Sinigardi 6 years ago
parent b3579380dc
commit 4ae778defc
  1. 2
      src/darkunistd.h
  2. 2
      src/getopt.c
  3. 35
      src/go.c
  4. 2
      src/im2col_kernels.cu
  5. 3
      src/utils.c

@ -9,7 +9,7 @@
#include <Winsock2.h>
#include <direct.h> /* for _getcwd() and _chdir() */
#include <getopt.h>
#include "getopt.h"
#include <io.h>
#include <process.h> /* for getpid() and the exec..() family */
#include <stdlib.h>

@ -1,5 +1,5 @@
#ifdef _WIN32
#include <getopt.h>
#include "getopt.h"
#ifdef __cplusplus
extern "C" {

@ -10,7 +10,8 @@
int inverted = 1;
int noi = 1;
static const unsigned int n_ind = 5;
//static const unsigned int n_ind = 5;
#define n_ind 5
typedef struct {
char **data;
@ -357,7 +358,7 @@ int generate_move(network net, int player, float *board, int multi, float thresh
predict_move(net, board, move, multi);
if (player < 0) flip_board(board);
for(i = 0; i < 19; ++i){
for(j = 0; j < 19; ++j){
if (!legal_go(board, ko, player, i, j)) move[i*19 + j] = 0;
@ -392,7 +393,7 @@ int generate_move(network net, int player, float *board, int multi, float thresh
}
if(suicide_go(board, player, row, col)){
return -1;
return -1;
}
if(suicide_go(board, player, index/19, index%19)) index = max;
return index;
@ -461,17 +462,17 @@ void engine_go(char *filename, char *weightfile, int multi)
} else if (!strcmp(buff, "known_command")){
char comm[256];
scanf("%s", comm);
int known = (!strcmp(comm, "protocol_version") ||
!strcmp(comm, "name") ||
!strcmp(comm, "version") ||
!strcmp(comm, "known_command") ||
!strcmp(comm, "list_commands") ||
!strcmp(comm, "quit") ||
!strcmp(comm, "boardsize") ||
!strcmp(comm, "clear_board") ||
!strcmp(comm, "komi") ||
!strcmp(comm, "final_status_list") ||
!strcmp(comm, "play") ||
int known = (!strcmp(comm, "protocol_version") ||
!strcmp(comm, "name") ||
!strcmp(comm, "version") ||
!strcmp(comm, "known_command") ||
!strcmp(comm, "list_commands") ||
!strcmp(comm, "quit") ||
!strcmp(comm, "boardsize") ||
!strcmp(comm, "clear_board") ||
!strcmp(comm, "komi") ||
!strcmp(comm, "final_status_list") ||
!strcmp(comm, "play") ||
!strcmp(comm, "genmove"));
if(known) printf("=%s true\n\n", ids);
else printf("=%s false\n\n", ids);
@ -575,7 +576,7 @@ void engine_go(char *filename, char *weightfile, int multi)
}
}
fprintf(f, "final_status_list dead\n");
fclose(f);
fclose(f);
#ifdef _WIN32
FILE *p = _popen("./gnugo --mode gtp < game.txt", "r");
#else
@ -716,7 +717,7 @@ float score_game(float *board)
}
}
fprintf(f, "final_score\n");
fclose(f);
fclose(f);
#ifdef _WIN32
FILE *p = _popen("./gnugo --mode gtp < game.txt", "r");
#else
@ -841,5 +842,3 @@ void run_go(int argc, char **argv)
else if(0==strcmp(argv[2], "test")) test_go(cfg, weights, multi);
else if(0==strcmp(argv[2], "engine")) engine_go(cfg, weights, multi);
}

@ -1,4 +1,4 @@
#include <cuda_runtime.h>
#include <cuda_runtime.h>
#include <curand.h>
#include <cublas_v2.h>
#include <stdint.h>

@ -13,6 +13,9 @@
#include <sys/time.h>
#endif
#ifndef USE_CMAKE_LIBS
#pragma warning(disable: 4996)
#endif
double what_time_is_it_now()
{

Loading…
Cancel
Save