2 Replies Latest reply on Aug 11, 2010 3:19 PM by jeff_golds

    gettimeofday() does not work with AMD openCL

    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 <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

        • gettimeofday() does not work with AMD openCL
          genaganna

           

          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.

           

          • gettimeofday() does not work with AMD openCL
            jeff_golds

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

            Jeff