|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
#include "ittnotify.h"
|
|
|
|
|
|
#ifndef INTEL_NO_ITTNOTIFY_API
|
|
|
#if (defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)) && (ITT_PLATFORM == ITT_PLATFORM_WIN || ITT_PLATFORM == ITT_PLATFORM_POSIX)
|
|
|
#define ITT_ENABLE_LOW_OVERHEAD_ANNOTATIONS
|
|
|
#else
|
|
|
#error Zero cost (low overhead) annotations are not supported on this platform
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ITT_ENABLE_LOW_OVERHEAD_ANNOTATIONS
|
|
|
#pragma pack(push, 1)
|
|
|
typedef struct ___itt_zca_allocation_info {
|
|
|
size_t size;
|
|
|
void** ptr;
|
|
|
int initialized;
|
|
|
} __itt_zca_allocation_info;
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
#define __itt_zca_mem_allocate_begin() __notify_intrinsic((char*)"mem_allocate_begin", 0)
|
|
|
#define __itt_zca_mem_allocate_end(ptr, size, init) { __itt_zca_allocation_info __itt_zca_alloc_info = { size, ptr, init }; __notify_intrinsic((char*)"mem_allocate_end", (void*)&__itt_zca_alloc_info); }
|
|
|
#define __itt_zca_mem_free_begin(ptr) __notify_intrinsic((char*)"mem_free_begin", (void*)ptr)
|
|
|
#define __itt_zca_mem_free_end() __notify_intrinsic((char*)"mem_free_end", 0)
|
|
|
#else
|
|
|
#define __itt_zca_mem_allocate_begin()
|
|
|
#define __itt_zca_mem_allocate_end(ptr, size, init)
|
|
|
#define __itt_zca_mem_free_begin(ptr)
|
|
|
#define __itt_zca_mem_free_end()
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ITT_ENABLE_LOW_OVERHEAD_ANNOTATIONS
|
|
|
#define __itt_zca_suppress_push(id) __notify_zc_intrinsic((char*)"__itt_suppress_push", (void*)id);
|
|
|
#define __itt_zca_suppress_pop(id) __notify_zc_intrinsic((char*)"__itt_suppress_pop", (void*)id);
|
|
|
#define __itt_zca_sync_create(id) __notify_zc_intrinsic((char*)"__itt_sync_create", (void*)id)
|
|
|
#define __itt_zca_sync_acquired(id) __notify_zc_intrinsic((char*)"__itt_sync_acquired", (void*)id)
|
|
|
#define __itt_zca_sync_releasing(id) __notify_zc_intrinsic((char*)"__itt_sync_releasing", (void*)id)
|
|
|
#define __itt_zca_sync_destroy(id) __notify_zc_intrinsic((char*)"__itt_sync_destroy", (void*)id)
|
|
|
#else
|
|
|
#define __itt_zca_suppress_push(id)
|
|
|
#define __itt_zca_suppress_pop(id)
|
|
|
#define __itt_zca_sync_create(id)
|
|
|
#define __itt_zca_sync_acquired(id)
|
|
|
#define __itt_zca_sync_releasing(id)
|
|
|
#define __itt_zca_sync_destroy(id)
|
|
|
#endif
|
|
|
|