Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / RigidBodyGpuPipeline / opencl / primitives / Adl / AdlStopwatch.inl
1 /*
2 Copyright (c) 2012 Advanced Micro Devices, Inc.  
3
4 This software is provided 'as-is', without any express or implied warranty.
5 In no event will the authors be held liable for any damages arising from the use of this software.
6 Permission is granted to anyone to use this software for any purpose, 
7 including commercial applications, and to alter it and redistribute it freely, 
8 subject to the following restrictions:
9
10 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
11 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
12 3. This notice may not be removed or altered from any source distribution.
13 */
14 //Originally written by Takahiro Harada
15
16
17 namespace adl
18 {
19
20 void Stopwatch::init( const Device* deviceData )
21 {
22         ADLASSERT( m_impl == 0 );
23
24         if( deviceData )
25         {
26                 switch( deviceData->m_type )
27                 {
28 #if defined(ADL_ENABLE_CL)
29                 case TYPE_CL:
30                         m_impl = new StopwatchHost;//StopwatchCL
31                         break;
32 #endif
33 #if defined(ADL_ENABLE_DX11)
34                 case TYPE_DX11:
35                         m_impl = new StopwatchHost;//StopwatchDX11;
36                         break;
37 #endif
38                 case TYPE_HOST:
39                         m_impl = new StopwatchHost;
40                         break;
41                 default:
42                         ADLASSERT(0);
43                         break;
44                 };
45         }
46         else
47         {
48                 m_impl = new StopwatchHost;
49         }
50         m_impl->init( deviceData );
51 }
52
53 Stopwatch::~Stopwatch()
54 {
55         if( m_impl == 0 ) return;
56         delete m_impl;
57 }
58
59 };