@@ -125,13 +125,15 @@ bool do_test(
125125
126126int main (int argc, char ** argv)
127127{
128+ bool verbose = false ;
128129 int platformIndex = 0 ;
129130 int deviceIndex = 0 ;
130131
131132 bool build = false ;
132133
133134 {
134135 popl::OptionParser op (" Supported Options" );
136+ op.add <popl::Switch, popl::Attribute::advanced>(" v" , " verbose" , " Verbose Output" , &verbose);
135137 op.add <popl::Value<int >>(" p" , " platform" , " Platform Index" , platformIndex, &platformIndex);
136138 op.add <popl::Value<int >>(" d" , " device" , " Device Index" , deviceIndex, &deviceIndex);
137139 op.add <popl::Switch>(" b" , " build" , " Build the programs vs. dumping files" , &build);
@@ -152,24 +154,11 @@ int main(int argc, char** argv)
152154 }
153155 }
154156
155- std::vector<cl::Platform> platforms;
156- cl::Platform::get (&platforms);
157-
158- if (!checkPlatformIndex (platforms, platformIndex)) {
157+ cl::Device device;
158+ if (!setupDevice (device, platformIndex, deviceIndex, verbose)) {
159159 return -1 ;
160160 }
161161
162- cl::Platform& platform = platforms[platformIndex];
163- printf (" Running on platform: %s\n " ,
164- platform.getInfo <CL_PLATFORM_NAME >().c_str () );
165-
166- std::vector<cl::Device> devices;
167- platform.getDevices (CL_DEVICE_TYPE_ALL , &devices);
168-
169- cl::Device& device = devices[deviceIndex];
170- printf (" Running on device: %s\n " ,
171- device.getInfo <CL_DEVICE_NAME >().c_str () );
172-
173162 cl::Context context{device};
174163
175164 cl_version spvVersion = 0 ;
0 commit comments