Add clock() function to standard library.

Also corrected the declaration of num_cores() to return a
uniform value.
This commit is contained in:
Matt Pharr
2012-01-22 13:05:27 -08:00
parent 1f0f2ec05f
commit d805e8b183
3 changed files with 39 additions and 4 deletions

View File

@@ -787,10 +787,14 @@ packed_store_active(uniform int * uniform a, int vals) {
///////////////////////////////////////////////////////////////////////////
// System information
static inline int num_cores() {
static inline uniform int num_cores() {
return __num_cores();
}
static inline uniform int64 clock() {
return __clock();
}
///////////////////////////////////////////////////////////////////////////
// Atomics and memory barriers