Version
menu_open
link
Wwise SDK 2018.1.11
AkPlatformFuncs.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: <VERSION> Build: <BUILDNUMBER>
25  Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkPlatformFuncs.h
29 
30 /// \file
31 /// Platform-dependent functions definition.
32 
33 #ifndef _AK_TOOLS_COMMON_AKPLATFORMFUNCS_H
34 #define _AK_TOOLS_COMMON_AKPLATFORMFUNCS_H
35 
37 
38 // Uncomment the following to enable built-in platform profiler markers in the sound engine
39 //#define AK_ENABLE_INSTRUMENT
40 
41 #if defined(AK_WIN) || defined(AK_XBOXONE)
43 
44 #elif defined (AK_APPLE)
46 #include <AK/Tools/POSIX/AkPlatformFuncs.h>
47 
48 #elif defined (AK_ANDROID)
50 
51 #elif defined (AK_PS4)
53 
54 #elif defined (AK_EMSCRIPTEN)
55 #include <AK/Tools/Emscripten/AkPlatformFuncs.h>
56 
57 #elif defined (AK_LINUX)
59 #include <AK/Tools/POSIX/AkPlatformFuncs.h>
60 
61 #elif defined (AK_QNX)
62 #include <AK/Tools/QNX/AkPlatformFuncs.h>
63 #include <AK/Tools/POSIX/AkPlatformFuncs.h>
64 
65 #elif defined (AK_NX)
67 
68 #else
69 #error AkPlatformFuncs.h: Undefined platform
70 #endif
71 
72 #ifndef AkPrefetchZero
73 #define AkPrefetchZero(___Dest, ___Size)
74 #endif
75 
76 #ifndef AkPrefetchZeroAligned
77 #define AkPrefetchZeroAligned(___Dest, ___Size)
78 #endif
79 
80 #ifndef AkZeroMemAligned
81 #define AkZeroMemAligned(___Dest, ___Size) AKPLATFORM::AkMemSet(___Dest, 0, ___Size);
82 #endif
83 #ifndef AkZeroMemLarge
84 #define AkZeroMemLarge(___Dest, ___Size) AKPLATFORM::AkMemSet(___Dest, 0, ___Size);
85 #endif
86 #ifndef AkZeroMemSmall
87 #define AkZeroMemSmall(___Dest, ___Size) AKPLATFORM::AkMemSet(___Dest, 0, ___Size);
88 #endif
89 
90 #ifndef AkAllocaSIMD
91 #define AkAllocaSIMD( _size_ ) AkAlloca( _size_ )
92 #endif
93 
94 #ifndef AK_THREAD_INIT_CODE
95 #define AK_THREAD_INIT_CODE(_threadProperties)
96 #endif
97 
98 /// Utility functions
99 namespace AK
100 {
101  /// Count non-zero bits.
102  /// \return Number of channels.
104  {
105  AkUInt32 num = 0;
106  while( in_uWord ){ ++num; in_uWord &= in_uWord-1; }
107  return num;
108  }
109 }
110 
111 namespace AKPLATFORM
112 {
114  {
115  AkGetDefaultThreadProperties(out_threadProperties);
116  out_threadProperties.nPriority = AK_THREAD_PRIORITY_ABOVE_NORMAL;
117  }
118 }
119 
120 #ifndef AK_PERF_RECORDING_RESET
121 #define AK_PERF_RECORDING_RESET()
122 #endif
123 #ifndef AK_PERF_RECORDING_START
124 #define AK_PERF_RECORDING_START( __StorageName__, __uExecutionCountStart__, __uExecutionCountStop__ )
125 #endif
126 #ifndef AK_PERF_RECORDING_STOP
127 #define AK_PERF_RECORDING_STOP( __StorageName__, __uExecutionCountStart__, __uExecutionCountStop__ )
128 #endif
129 
130 #ifndef AK_INSTRUMENT_BEGIN
131  #define AK_INSTRUMENT_BEGIN( _zone_name_ )
132  #define AK_INSTRUMENT_END( _zone_name_ )
133  #define AK_INSTRUMENT_SCOPE( _zone_name_ )
134 
135  #define AK_INSTRUMENT_BEGIN_C(_colour_, _zone_name_ )
136 
137  #define AK_INSTRUMENT_IDLE_BEGIN( _zone_name_ )
138  #define AK_INSTRUMENT_IDLE_END( _zone_name_ )
139  #define AK_INSTRUMENT_IDLE_SCOPE( _zone_name_ )
140 
141  #define AK_INSTRUMENT_STALL_BEGIN( _zone_name_ )
142  #define AK_INSTRUMENT_STALL_END( _zone_name_ )
143  #define AK_INSTRUMENT_STALL_SCOPE( _zone_name_ )
144 
145  #define AK_INSTRUMENT_THREAD_START( _thread_name_ )
146 #endif
147 
148 #endif // _AK_TOOLS_COMMON_AKPLATFORMFUNCS_H
#define AK_THREAD_PRIORITY_ABOVE_NORMAL
Definition: AkPlatformFuncs.h:79
int nPriority
Thread priority.
Definition: AkPlatformFuncs.h:50
Audiokinetic namespace.
void AkGetDefaultHighPriorityThreadProperties(AkThreadProperties &out_threadProperties)
Definition: AkPlatformFuncs.h:113
#define AkForceInline
Force inlining.
Definition: AkTypes.h:63
AkForceInline AkUInt32 GetNumNonZeroBits(AkUInt32 in_uWord)
Definition: AkPlatformFuncs.h:103
AkForceInline void AkGetDefaultThreadProperties(AkThreadProperties &out_threadProperties)
Platform Independent Helper.
Definition: AkPlatformFuncs.h:237
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:79

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise