c - Compilers C99 GNU99 -
any appreciated. in advance
i not able use functions in time.h
inside kernel.cl
file
my main.cpp
able use includes.
my time.h
is /usr/include
, have tried using std=gnu99
, somehow still thinking using c99
my kernel.cl has
#include "time.h" #define _posix_c_source >= 199309l**** ..... ..... struct timespec tp_start, tp_end; clock_gettime(clock_monotonic, &tp_start);
and errors are
g++ -c -o3 -fopenmp -i/usr/include main.cpp echo compiling main.cpp compiling main.cpp cl6x -mv6600 --abi=eabi -i/include -i/usr/share/ti/cgt-c6x/include -i/usr/share/ti/opencl -i/usr/include -c -o3 ccode.c echo compiling ccode.c compiling ccode.c clocl -i/usr/include -std=gnu99 kernel.cl ccode.obj kernel.cl:50:17: error: variable has incomplete type 'struct timespec' kernel.cl:50:8: note: forward declaration of 'struct timespec' kernel.cl:50:27: error: variable has incomplete type 'struct timespec' kernel.cl:50:8: note: forward declaration of 'struct timespec' kernel.cl:51:1: warning: implicit declaration of function 'clock_gettime' invalid in c99 kernel.cl:51:15: error: use of undeclared identifier 'clock_monotonic
you compiling texas instruments-specific compiler use embedded device. manpage clock_gettime()
on linux implies not posix systems implement api, , tells how check:
"on posix systems on these functions available, symbol _posix_timers defined in value greater 0. symbols _posix_monotonic_clock, _posix_cputime, _posix_thread_cputime indicate clock_monotonic, clock_process_cputime_id, clock_thread_cputime_id available. (see sysconf(3).)"
so, if _posix_timers in unistd.h 0 or undefined, routine not available on device standard library provided compiler.
Comments
Post a Comment