diff --git a/src/Examples/FileExample.cpp b/src/Examples/FileExample.cpp index e0e81ab9123cc78fca3e588f636aedb710602324..f5f3912ddf6d9031e7c3e9c88541be121744fb44 100644 --- a/src/Examples/FileExample.cpp +++ b/src/Examples/FileExample.cpp @@ -19,7 +19,6 @@ int main() file.read( title2, 4); file.close(); - if fileExists( "new-file.tnl" ) - std::remove( "new-file.tnl" ); + cout << "title2:" << title2 <<endl; } diff --git a/src/Examples/TimerExample.cpp b/src/Examples/TimerExample.cpp index 772c9907bdcfdb2329c5b7ae5b56801fb7818ffc..4ca3e58276cd6aa99ea10be70cd1210ab6b62b2a 100644 --- a/src/Examples/TimerExample.cpp +++ b/src/Examples/TimerExample.cpp @@ -1,13 +1,16 @@ #include <iostream> #include <TNL/Timer.h> +#include <unistd.h> using namespace TNL; using namespace std; int main() { + unsigned int microseconds = 0.5; Timer time; time.start(); + usleep(microseconds); time.stop(); time.getRealTime(); time.reset(); diff --git a/src/TNL/File.h b/src/TNL/File.h index bb31cdcd27ae86d33b6bcc27479d6a1519c30993..20fb1fe7b3d815117faee8915cf217d9dbfa6e16 100644 --- a/src/TNL/File.h +++ b/src/TNL/File.h @@ -37,7 +37,7 @@ enum class IOMode const size_t FileGPUvsCPUTransferBufferSize = 5 * 2<<20; -///\brief Class file is aimed mainly for the binary data. +///\brief Class file is aimed mainly for saving and loading binary data. /// /// \par Example /// \include FileExample.cpp @@ -59,10 +59,10 @@ class File public: - /// Basic constructor. + /// \brief Basic constructor. File(); - /// Destructor. + /// \brief Destructor. ~File(); ///// @@ -95,8 +95,12 @@ class File /// \brief Method that can write particular data type from given file into GPU. (Function that gets particular elements from given file.) /// - /// Returns boolean value based on the succes in reading elements from given file. - /// \param buffer Pointer in memory (where the read elements are stored?). + /// Returns \e true when the elements are successfully read from given file. Otherwise returns \e false. + /// + /// \tparam Type Type of data. + /// \tparam Device Place where data are stored after reading from file. For example Devices::Host or Devices::Cuda. + /// \tparam Index Type of index by which the elements are indexed. + /// \param buffer Pointer in memory where the elements are loaded and stored after reading. /// \param elements Number of elements the user wants to get (read) from given file. template< typename Type, typename Device = Devices::Host, typename Index = int > bool read( Type* buffer, @@ -109,7 +113,11 @@ class File /// \brief Method that can write particular data type from CPU into given file. (Function that writes particular elements into given file.) /// /// Returns boolean value based on the succes in writing elements into given file. - /// \param buffer Pointer in memory. + /// + /// \tparam Type Type of data. + /// \tparam Device Place from where data are loaded before writing into file. For example Devices::Host or Devices::Cuda. + /// \tparam Index Type of index by which the elements are indexed. + /// \param buffer Pointer in memory from where the elements are loaded before writing into file. /// \param elements Number of elements the user wants to write into the given file. template< typename Type, typename Device = Devices::Host, typename Index = int > bool write( const Type* buffer, diff --git a/src/TNL/Timer.h b/src/TNL/Timer.h index f347c45102baef7a61c90639ab70a53ca7f34165..b90fabce7b2beaece7ee3799939139865a5d836b 100644 --- a/src/TNL/Timer.h +++ b/src/TNL/Timer.h @@ -49,21 +49,21 @@ class Timer /// \brief Starts timer. /// /// Starts all time and cycle measurements such as real time, CPU time and - /// CPU cycles. Function start() can be used also after using stop() function. + /// CPU cycles. Method start() can be used also after using stop() method. /// The timer then continues measuring the time without reseting. void start(); ///// /// \brief Returns the elapsed time on given timer. /// - /// It returns the elapsed time between calling the start() and stop() functions. - /// Starts counting the real time after the function start() is called and - /// pauses when the function stop() is called. + /// It returns the elapsed time between calling the start() and stop() methods. + /// Starts counting the real time after the method start() is called and + /// pauses when the method stop() is called. /// If the timer have been started more then once without resetting, /// the real time is counted by adding all intervals (between start and stop - /// functions) together. + /// methods) together. /// This function can be called while the timer is running, there is no - /// need to use stop() function first. + /// need to use stop() method first. double getRealTime() const; ///// @@ -86,7 +86,7 @@ class Timer /// \brief Function for measuring the real time. /// - /// Returns the current calendar time. + /// Returns number of seconds since Epoch, 1970-01-01 00:00:00 UTC. double readRealTime() const; /// \brief Function for measuring the CPU time.