From: Karl R. <ru...@iu...> - 2021-11-19 07:49:11
|
Indeed! Line 58 causes the error: https://github.com/viennacl/viennacl-dev/blob/master/viennacl/ocl/platform.hpp However, these lines are *exactly* the same as in the minimal example; but the minimal example succeeds. Also, this is the very first call to OpenCL, so there can't be any prior undetected errors. What happens if you compile manually? In the main ViennaCL folder: $> g++ example/tutorial/blas1.cpp -I. -lOpenCL -L/home/jbelloch/EQU_FILTERING_sandra/opencl/lib/ and then $> ./a.out Best regards, Karli On 11/19/21 08:37, SANDRA CATALAN PALLARES wrote: > The mistery continues: > > jbelloch@odroid:~/EQU_FILTERING_sandra/test_opencl$ ./a.out > # Platforms found: 1 > 0 > > Best regards, > Sandra > > El vie, 19 nov 2021 a las 8:33, Karl Rupp (<ru...@iu... > <mailto:ru...@iu...>>) escribió: > > > Good morning, > > oh - now I'm puzzled. :-/ > > Can you please add a > std::cout << err << std::endl; > after > std::cout << "# Platforms found: " << num_platforms << std::endl; > > Which value do you get? Maybe clGetPlatformIDs returns a nonzero > error code? > > Best regards, > Karli > > On 11/19/21 08:29, SANDRA CATALAN PALLARES wrote: > > Hi, > > > > The example is working :) > > > > jbelloch@odroid:~/EQU_FILTERING_sandra/test_opencl$ g++ test.cpp > > -lOpenCL -L/home/jbelloch/EQU_FILTERING_sandra/opencl/lib/ > > jbelloch@odroid:~/EQU_FILTERING_sandra/test_opencl$ ./a.out > > # Platforms found: 1 > > > > Cheers, > > Sandra > > > > El jue, 18 nov 2021 a las 19:48, Karl Rupp > (<ru...@iu... <mailto:ru...@iu...> > > <mailto:ru...@iu... <mailto:ru...@iu...>>>) > escribió: > > > > thanks! This indicates that there is no OpenCL platform > detected on > > your > > system. Basically this is the simplest query of all. > > > > Can you try to compile and run the following minimal example? > > > > > > #include <iostream> > > #include <string> > > #include <vector> > > #include <cmath> > > #include <stdexcept> > > > > #ifdef __APPLE__ > > #include <OpenCL/cl.h> > > #else > > #include <CL/cl.h> > > #endif > > > > int main() > > { > > cl_uint num_platforms; > > cl_platform_id platform_ids[42]; > > cl_int err = clGetPlatformIDs(42, platform_ids, > &num_platforms); > > std::cout << "# Platforms found: " << num_platforms << > std::endl; > > > > return 0; > > } > > > > > > > > $> g++ test.cpp -lOpenCL > > -L/home/jbelloch/EQU_FILTERING_sandra/opencl/lib/ > > > > should produce the executable a.out. > > > > It should return at least one platform. > > > > Thanks and best regards, > > Karli > > > > > > > > > > > > > > -- > > *Sandra Catalán Pallarés* > SecciónDept. Arquitectura de Computadores y Automática > Facultad de Ciencias Físicas - Desp. 223 > Universidad Complutense de Madrid > 28040 - Madrid (Spain) > (+34) 91 394 *4394 - *sca...@uc... <mailto:sca...@uc...> |