| 61 | PGL_DEVICE_TYPE device_type{PGL_DEVICE_TYPE_NONE}; |
| 62 | |
| 63 | bool validate() |
| 64 | { |
| 65 | bool valid = true; |
| 66 | |
| 67 | switch (type) |
| 68 | { |
| 69 | case HELP: |
| 70 | break; |
| 71 | |
| 72 | case INIT_FIELD: |
| 73 | if(field_file_name == ""/* || |
| 74 | !file_exists(field_file_name)*/) |
| 75 | { |
| 76 | std::cout << "ERROR: Field output file not set." << std::endl; |
| 77 | valid = false; |
| 78 | } |
| 79 | if(samples_file_names.size() == 0 /*|| |
| 80 | !file_exists(samples_file_name)*/) |
| 81 | { |
| 82 | std::cout << "ERROR: Samples file not set" << std::endl; |
| 83 | valid = false; |
| 84 | } |
| 85 | else |
| 86 | { |
| 87 | for (int i = 0; i < samples_file_names.size(); i++) |
| 88 | { |
| 89 | if (!file_exists(samples_file_names[i])) |
| 90 | { |
| 91 | std::cout << "ERROR: Samples file does not exists: " << samples_file_names[i] << std::endl; |
| 92 | valid = false; |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | if (device_type == PGL_DEVICE_TYPE_NONE) |
| 97 | { |
| 98 | std::cout << "ERROR: Device type not set." << std::endl; |
| 99 | valid = false; |
| 100 | } |
| 101 | |
| 102 | break; |
| 103 | |
| 104 | case BENCH_LOOKUP_SAMPLE: |
| 105 | case BENCH_LOOKUP: |
| 106 | if (field_file_name == "" || !file_exists(field_file_name)) |
| 107 | { |
| 108 | std::cout << "ERROR: Field file not set or does not exists: " << field_file_name << std::endl; |
| 109 | valid = false; |
| 110 | } |
| 111 | if (device_type == PGL_DEVICE_TYPE_NONE) |
| 112 | { |
| 113 | std::cout << "ERROR: Device type not set." << std::endl; |
| 114 | valid = false; |
| 115 | } |
| 116 | break; |
| 117 | |
| 118 | case NONE: |
| 119 | valid = false; |
| 120 | break; |
no test coverage detected