|
|
@@ -283,13 +283,18 @@ static void controllerconn_event_cb(struct bufferevent *bev, short events,
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
{
|
|
|
- if (argc != 3) {
|
|
|
- fprintf(stderr, "Usage: %s controller_host controller_port\n", argv[0]);
|
|
|
+ if (argc != 4) {
|
|
|
+ fprintf(stderr, "Usage: %s controller_host controller_port cuda_dev_id\n", argv[0]);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
unsigned short controller_port = strtoul(argv[2], NULL, 10);
|
|
|
|
|
|
+ if (cuda_init(strtoul(argv[3], NULL, 10)) < 0) {
|
|
|
+ cerr << "Error setting CUDA device\n";
|
|
|
+ exit(1);
|
|
|
+ }
|
|
|
+
|
|
|
evthread_use_pthreads();
|
|
|
|
|
|
signal(SIGPIPE, SIG_IGN);
|