cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

akasheee
Journeyman III

gettimeofday() does not work with AMD openCL

Hi,

I tried to use gettimeofday() function to get timing in my OpenCL program, but it says,

hh.cpp: In function ‘int main(int, const char**)’:
hh.cpp:335: error: ‘gettimeofday’ was not declared in this scope

I included #include <sys/times.h> at the top. I am using gcc/g++ 4.4.1, Ubuntu 9.10 with AMD SDK 2.1. I could use clock() properly, but I think clock() is not accurate.

The same gettimeofday() was perfectly working when I used NVIDIA OpenCL.

If someone can suggest me I appreciate it.

 

Ashraf

0 Likes
2 Replies
genaganna
Journeyman III

Originally posted by: akasheee Hi,

 

I tried to use gettimeofday() function to get timing in my OpenCL program, but it says,

 

hh.cpp: In function ‘int main(int, const char**)’: hh.cpp:335: error: ‘gettimeofday’ was not declared in this scope

 

I included #include at the top. I am using gcc/g++ 4.4.1, Ubuntu 9.10 with AMD SDK 2.1. I could use clock() properly, but I think clock() is not accurate.

 

The same gettimeofday() was perfectly working when I used NVIDIA OpenCL.

 

If someone can suggest me I appreciate it.

 

 Ashraf

 



I don't think this is a problem with AMD OpenCL. Please check whether includes are proper or not.

 

0 Likes

Try "<sys/time.h>" instead of "<sys/times.h>".

Jeff

0 Likes