klaus-p commited on
Commit
c5539ea
·
1 Parent(s): 7ca0e1f

Option to choose gpu in cofig file

Browse files
Files changed (1) hide show
  1. engine_wrapper.py +4 -0
engine_wrapper.py CHANGED
@@ -9,6 +9,7 @@ def create_engine(config, board):
9
  engine_path = os.path.join(cfg["dir"], cfg["name"])
10
  weights = os.path.join(cfg["dir"], cfg["weights"]) if "weights" in cfg else None
11
  threads = cfg.get("threads")
 
12
 
13
  # TODO: ucioptions should probably be a part of the engine subconfig
14
  ucioptions = config.get("ucioptions")
@@ -20,6 +21,9 @@ def create_engine(config, board):
20
  if threads:
21
  commands.append("-t")
22
  commands.append(str(threads))
 
 
 
23
 
24
  if engine_type == "xboard":
25
  return XBoardEngine(board, commands, config.get("xboardoptions"))
 
9
  engine_path = os.path.join(cfg["dir"], cfg["name"])
10
  weights = os.path.join(cfg["dir"], cfg["weights"]) if "weights" in cfg else None
11
  threads = cfg.get("threads")
12
+ gpu = cfg.get("gpu")
13
 
14
  # TODO: ucioptions should probably be a part of the engine subconfig
15
  ucioptions = config.get("ucioptions")
 
21
  if threads:
22
  commands.append("-t")
23
  commands.append(str(threads))
24
+ if gpu:
25
+ commands.append("--gpu")
26
+ commands.append(str(gpu))
27
 
28
  if engine_type == "xboard":
29
  return XBoardEngine(board, commands, config.get("xboardoptions"))