no message

This commit is contained in:
songwei
2025-04-27 11:12:54 +08:00
parent caaccc55df
commit 17301ed068
22 changed files with 1378 additions and 219 deletions

View File

@@ -42,6 +42,7 @@ typedef NS_ENUM(NSInteger, JPMetalViewContentMode) {
@property (nonatomic, strong) id<MTLTexture> bfgTexture;
@property (nonatomic, assign)GLuint frame_blending_mode_uniform;
@property (nonatomic, strong) dispatch_queue_t metalQueue;
@property (nonatomic, strong) id <MTLDevice> device;
@end
@implementation DIMetalView
- (instancetype)initWithFrame:(CGRect)frame
@@ -57,6 +58,7 @@ typedef NS_ENUM(NSInteger, JPMetalViewContentMode) {
}
self.mtkView = [[MTKView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, height)];
self.mtkView.device = MTLCreateSystemDefaultDevice(); // 获取默认的device
NSString *version = [UIDevice currentDevice].systemVersion;
if(version.doubleValue>=15.0&&version.doubleValue<16.0)
{
@@ -69,8 +71,7 @@ typedef NS_ENUM(NSInteger, JPMetalViewContentMode) {
self.mtkView.clearColor = MTLClearColorMake(0.0, 0.0, 0.0, 0);
self.mtkView.sampleCount = 1;
self.mtkView.framebufferOnly = NO;
self.mtkView.framebufferOnly = YES;
[self addSubview:self.mtkView];
self.mtkView.delegate = self;

View File

@@ -24,10 +24,6 @@
#include <stdlib.h>
#if NCNN_VULKAN
#include <vulkan/vulkan.h>
#endif // NCNN_VULKAN
#if NCNN_PLATFORM_API
#if __ANDROID_API__ >= 26
#include <android/hardware_buffer.h>

View File

@@ -26,7 +26,7 @@
extern "C" {
#endif
NCNN_EXPORT const char* ncnn_version();
NCNN_EXPORT const char* ncnn_version(void);
/* allocator api */
typedef struct __ncnn_allocator_t* ncnn_allocator_t;
@@ -38,14 +38,14 @@ struct NCNN_EXPORT __ncnn_allocator_t
void (*fast_free)(ncnn_allocator_t allocator, void* ptr);
};
NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_pool_allocator();
NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_unlocked_pool_allocator();
NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_pool_allocator(void);
NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_unlocked_pool_allocator(void);
NCNN_EXPORT void ncnn_allocator_destroy(ncnn_allocator_t allocator);
/* option api */
typedef struct __ncnn_option_t* ncnn_option_t;
NCNN_EXPORT ncnn_option_t ncnn_option_create();
NCNN_EXPORT ncnn_option_t ncnn_option_create(void);
NCNN_EXPORT void ncnn_option_destroy(ncnn_option_t opt);
NCNN_EXPORT int ncnn_option_get_num_threads(const ncnn_option_t opt);
@@ -63,7 +63,7 @@ NCNN_EXPORT void ncnn_option_set_use_vulkan_compute(ncnn_option_t opt, int use_v
/* mat api */
typedef struct __ncnn_mat_t* ncnn_mat_t;
NCNN_EXPORT ncnn_mat_t ncnn_mat_create();
NCNN_EXPORT ncnn_mat_t ncnn_mat_create(void);
NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d(int w, ncnn_allocator_t allocator);
NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d(int w, int h, ncnn_allocator_t allocator);
NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d(int w, int h, int c, ncnn_allocator_t allocator);
@@ -140,7 +140,7 @@ NCNN_EXPORT void ncnn_blob_get_shape(const ncnn_blob_t blob, int* dims, int* w,
/* paramdict api */
typedef struct __ncnn_paramdict_t* ncnn_paramdict_t;
NCNN_EXPORT ncnn_paramdict_t ncnn_paramdict_create();
NCNN_EXPORT ncnn_paramdict_t ncnn_paramdict_create(void);
NCNN_EXPORT void ncnn_paramdict_destroy(ncnn_paramdict_t pd);
NCNN_EXPORT int ncnn_paramdict_get_type(const ncnn_paramdict_t pd, int id);
@@ -165,7 +165,7 @@ struct NCNN_EXPORT __ncnn_datareader_t
size_t (*read)(ncnn_datareader_t dr, void* buf, size_t size);
};
NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create();
NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create(void);
#if NCNN_STDIO
NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_stdio(FILE* fp);
#endif /* NCNN_STDIO */
@@ -206,7 +206,7 @@ struct NCNN_EXPORT __ncnn_layer_t
int (*forward_inplace_n)(const ncnn_layer_t layer, ncnn_mat_t* bottom_top_blobs, int n, const ncnn_option_t opt);
};
NCNN_EXPORT ncnn_layer_t ncnn_layer_create();
NCNN_EXPORT ncnn_layer_t ncnn_layer_create(void);
NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_typeindex(int typeindex);
#if NCNN_STRING
NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_type(const char* type);
@@ -269,12 +269,16 @@ struct __ncnn_net_t
ncnn_net_custom_layer_factory_t custom_layer_factory;
};
NCNN_EXPORT ncnn_net_t ncnn_net_create();
NCNN_EXPORT ncnn_net_t ncnn_net_create(void);
NCNN_EXPORT void ncnn_net_destroy(ncnn_net_t net);
NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net);
NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt);
#if NCNN_VULKAN
NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index);
#endif
#if NCNN_STRING
NCNN_EXPORT void ncnn_net_register_custom_layer_by_type(ncnn_net_t net, const char* type, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata);
#endif /* NCNN_STRING */
@@ -338,6 +342,29 @@ NCNN_EXPORT void ncnn_copy_make_border_3d(const ncnn_mat_t src, ncnn_mat_t dst,
NCNN_EXPORT void ncnn_copy_cut_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, const ncnn_option_t opt);
NCNN_EXPORT void ncnn_copy_cut_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, const ncnn_option_t opt);
#if NCNN_PIXEL_DRAWING
/* mat pixel drawing api*/
NCNN_EXPORT void ncnn_draw_rectangle_c1(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_rectangle_c2(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_rectangle_c3(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_rectangle_c4(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_text_c1(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
NCNN_EXPORT void ncnn_draw_text_c2(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
NCNN_EXPORT void ncnn_draw_text_c3(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
NCNN_EXPORT void ncnn_draw_text_c4(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
NCNN_EXPORT void ncnn_draw_circle_c1(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_circle_c2(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_circle_c3(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_circle_c4(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_line_c1(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_line_c2(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_line_c3(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
NCNN_EXPORT void ncnn_draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
#endif /* NCNN_PIXEL_DRAWING */
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -21,8 +21,6 @@
#include "mat.h"
#include <vulkan/vulkan.h>
namespace ncnn {
class Pipeline;

View File

@@ -17,7 +17,7 @@
#include <stddef.h>
#if (defined _WIN32 && !(defined __MINGW32__))
#if defined _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
@@ -40,7 +40,7 @@ public:
int num_enabled() const;
public:
#if (defined _WIN32 && !(defined __MINGW32__))
#if defined _WIN32
ULONG_PTR mask;
#endif
#if defined __ANDROID__ || defined __linux__
@@ -93,6 +93,12 @@ NCNN_EXPORT int cpu_support_x86_f16c();
NCNN_EXPORT int cpu_support_x86_avx2();
// avx_vnni = x86 avx vnni
NCNN_EXPORT int cpu_support_x86_avx_vnni();
// avx_vnni_int8 = x86 avx vnni int8
NCNN_EXPORT int cpu_support_x86_avx_vnni_int8();
// avx_vnni_int16 = x86 avx vnni int16
NCNN_EXPORT int cpu_support_x86_avx_vnni_int16();
// avx_ne_convert = x86 avx ne convert
NCNN_EXPORT int cpu_support_x86_avx_ne_convert();
// avx512 = x86 avx512f + avx512cd + avx512bw + avx512dq + avx512vl
NCNN_EXPORT int cpu_support_x86_avx512();
// avx512_vnni = x86 avx512 vnni
@@ -116,6 +122,10 @@ NCNN_EXPORT int cpu_support_loongson_mmi();
NCNN_EXPORT int cpu_support_riscv_v();
// zfh = riscv half-precision float
NCNN_EXPORT int cpu_support_riscv_zfh();
// zvfh = riscv vector half-precision float
NCNN_EXPORT int cpu_support_riscv_zvfh();
// xtheadvector = riscv xtheadvector
NCNN_EXPORT int cpu_support_riscv_xtheadvector();
// vlenb = riscv vector length in bytes
NCNN_EXPORT int cpu_riscv_vlenb();

View File

@@ -21,10 +21,6 @@
#include "mat.h"
#include <vulkan/vulkan.h>
#include "vulkan_header_fix.h"
namespace ncnn {
// instance
@@ -33,7 +29,7 @@ namespace ncnn {
// Creates a VkInstance object, Checks the extended attributes supported by the Vulkan instance concerned,
// Initializes, and creates Vulkan validation layers (if ENABLE_VALIDATION_LAYER is enabled),
// Iterates over all supported physical devices, etc.
NCNN_EXPORT int create_gpu_instance();
NCNN_EXPORT int create_gpu_instance(const char* driver_path = 0);
// Get global VkInstance variable
// Must be called after create_gpu_instance() and before destroy_gpu_instance()
@@ -41,8 +37,106 @@ NCNN_EXPORT VkInstance get_gpu_instance();
// Destroy VkInstance object and free the memory of the associated object
// Usually called in the destructor of the main program exit
// The function will internally ensure that all vulkan devices are idle before proceeding with destruction.
NCNN_EXPORT void destroy_gpu_instance();
// vulkan core
extern PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
extern PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
extern PFN_vkAllocateMemory vkAllocateMemory;
extern PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
extern PFN_vkBindBufferMemory vkBindBufferMemory;
extern PFN_vkBindImageMemory vkBindImageMemory;
extern PFN_vkCmdBeginQuery vkCmdBeginQuery;
extern PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
extern PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
extern PFN_vkCmdBindPipeline vkCmdBindPipeline;
extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
extern PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
extern PFN_vkCmdCopyImage vkCmdCopyImage;
extern PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer;
extern PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults;
extern PFN_vkCmdDispatch vkCmdDispatch;
extern PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect;
extern PFN_vkCmdEndQuery vkCmdEndQuery;
extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands;
extern PFN_vkCmdFillBuffer vkCmdFillBuffer;
extern PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
extern PFN_vkCmdPushConstants vkCmdPushConstants;
extern PFN_vkCmdResetQueryPool vkCmdResetQueryPool;
extern PFN_vkCmdResolveImage vkCmdResolveImage;
extern PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer;
extern PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp;
extern PFN_vkCreateBuffer vkCreateBuffer;
extern PFN_vkCreateBufferView vkCreateBufferView;
extern PFN_vkCreateCommandPool vkCreateCommandPool;
extern PFN_vkCreateComputePipelines vkCreateComputePipelines;
extern PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
extern PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
extern PFN_vkCreateDevice vkCreateDevice;
extern PFN_vkCreateFence vkCreateFence;
extern PFN_vkCreateImage vkCreateImage;
extern PFN_vkCreateImageView vkCreateImageView;
extern PFN_vkCreatePipelineCache vkCreatePipelineCache;
extern PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
extern PFN_vkCreateQueryPool vkCreateQueryPool;
extern PFN_vkCreateSampler vkCreateSampler;
extern PFN_vkCreateSemaphore vkCreateSemaphore;
extern PFN_vkCreateShaderModule vkCreateShaderModule;
extern PFN_vkDestroyBuffer vkDestroyBuffer;
extern PFN_vkDestroyBufferView vkDestroyBufferView;
extern PFN_vkDestroyCommandPool vkDestroyCommandPool;
extern PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
extern PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
extern PFN_vkDestroyDevice vkDestroyDevice;
extern PFN_vkDestroyFence vkDestroyFence;
extern PFN_vkDestroyImage vkDestroyImage;
extern PFN_vkDestroyImageView vkDestroyImageView;
extern PFN_vkDestroyInstance vkDestroyInstance;
extern PFN_vkDestroyPipeline vkDestroyPipeline;
extern PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
extern PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
extern PFN_vkDestroyQueryPool vkDestroyQueryPool;
extern PFN_vkDestroySampler vkDestroySampler;
extern PFN_vkDestroySemaphore vkDestroySemaphore;
extern PFN_vkDestroyShaderModule vkDestroyShaderModule;
extern PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
extern PFN_vkEndCommandBuffer vkEndCommandBuffer;
extern PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
extern PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties;
extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
extern PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
extern PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
extern PFN_vkFreeMemory vkFreeMemory;
extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
extern PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment;
extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
extern PFN_vkGetDeviceQueue vkGetDeviceQueue;
extern PFN_vkGetFenceStatus vkGetFenceStatus;
extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
extern PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures;
extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties;
extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties;
extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
extern PFN_vkGetPipelineCacheData vkGetPipelineCacheData;
extern PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
extern PFN_vkMapMemory vkMapMemory;
extern PFN_vkMergePipelineCaches vkMergePipelineCaches;
extern PFN_vkQueueSubmit vkQueueSubmit;
extern PFN_vkQueueWaitIdle vkQueueWaitIdle;
extern PFN_vkResetCommandBuffer vkResetCommandBuffer;
extern PFN_vkResetCommandPool vkResetCommandPool;
extern PFN_vkResetDescriptorPool vkResetDescriptorPool;
extern PFN_vkResetFences vkResetFences;
extern PFN_vkUnmapMemory vkUnmapMemory;
extern PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
extern PFN_vkWaitForFences vkWaitForFences;
// instance extension capability
extern int support_VK_KHR_external_memory_capabilities;
extern int support_VK_KHR_get_physical_device_properties2;
@@ -68,7 +162,6 @@ extern PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProp
extern PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR;
extern PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR;
extern PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR;
extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR;
// VK_KHR_get_surface_capabilities2
extern PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR;
@@ -114,6 +207,10 @@ public:
const char* device_name() const;
uint8_t* pipeline_cache_uuid() const;
// driver properties
uint32_t driver_id() const;
const char* driver_name() const;
// 0 = discrete gpu
// 1 = integrated gpu
// 2 = virtual gpu
@@ -168,9 +265,11 @@ public:
// fp16 and int8 feature
bool support_fp16_packed() const;
bool support_fp16_storage() const;
bool support_fp16_uniform() const;
bool support_fp16_arithmetic() const;
bool support_int8_packed() const;
bool support_int8_storage() const;
bool support_int8_uniform() const;
bool support_int8_arithmetic() const;
// ycbcr conversion feature
@@ -178,6 +277,7 @@ public:
// cooperative matrix feature
bool support_cooperative_matrix() const;
bool support_cooperative_matrix_8_8_16() const;
bool support_cooperative_matrix_16_8_8() const;
bool support_cooperative_matrix_16_8_16() const;
bool support_cooperative_matrix_16_16_16() const;
@@ -191,6 +291,7 @@ public:
int support_VK_KHR_cooperative_matrix() const;
int support_VK_KHR_dedicated_allocation() const;
int support_VK_KHR_descriptor_update_template() const;
int support_VK_KHR_driver_properties() const;
int support_VK_KHR_external_memory() const;
int support_VK_KHR_get_memory_requirements2() const;
int support_VK_KHR_maintenance1() const;
@@ -220,7 +321,7 @@ private:
GpuInfo& operator=(const GpuInfo&);
private:
friend int create_gpu_instance();
friend int create_gpu_instance(const char* driver_path);
GpuInfoPrivate* const d;
};
@@ -240,6 +341,7 @@ public:
const GpuInfo& info;
VkDevice vkdevice() const;
bool is_valid() const;
VkShaderModule compile_shader_module(const uint32_t* spv_data, size_t spv_data_size) const;
@@ -298,12 +400,6 @@ public:
PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR;
PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR;
// VK_KHR_create_renderpass2
PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR;
PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR;
PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR;
PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR;
// VK_KHR_descriptor_update_template
PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR;
PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR;
@@ -312,7 +408,6 @@ public:
// VK_KHR_get_memory_requirements2
PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR;
PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR;
PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR;
// VK_KHR_maintenance1
PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR;

View File

@@ -24,8 +24,6 @@
#if NCNN_VULKAN
#include "command.h"
#include "pipeline.h"
#include <vulkan/vulkan.h>
#endif // NCNN_VULKAN
namespace ncnn {
@@ -201,9 +199,19 @@ struct overwrite_builtin_layer_registry_entry
NCNN_EXPORT int layer_to_index(const char* type);
// create layer from type name
NCNN_EXPORT Layer* create_layer(const char* type);
NCNN_EXPORT Layer* create_layer_naive(const char* type);
NCNN_EXPORT Layer* create_layer_cpu(const char* type);
#if NCNN_VULKAN
NCNN_EXPORT Layer* create_layer_vulkan(const char* type);
#endif // NCNN_VULKAN
#endif // NCNN_STRING
// create layer from layer type
NCNN_EXPORT Layer* create_layer(int index);
NCNN_EXPORT Layer* create_layer_naive(int index);
NCNN_EXPORT Layer* create_layer_cpu(int index);
#if NCNN_VULKAN
NCNN_EXPORT Layer* create_layer_vulkan(int index);
#endif // NCNN_VULKAN
#define DEFINE_LAYER_CREATOR(name) \
::ncnn::Layer* name##_layer_creator(void* /*userdata*/) \

View File

@@ -106,4 +106,7 @@ Erf = 100,
Diag = 101,
CELU = 102,
Shrink = 103,
RMSNorm = 104,
Spectrogram = 105,
InverseSpectrogram = 106,

View File

@@ -41,10 +41,6 @@
#include "option.h"
#include "platform.h"
#if NCNN_VULKAN
#include <vulkan/vulkan.h>
#endif // NCNN_VULKAN
#if NCNN_PIXEL
#if NCNN_PLATFORM_API
#if __ANDROID_API__ >= 9
@@ -111,11 +107,15 @@ public:
#if __ARM_NEON
void fill(float32x4_t _v);
void fill(uint16x4_t _v);
#if !defined(_MSC_VER)
void fill(int32x4_t _v);
#endif
void fill(int32x4_t _v0, int32x4_t _v1);
#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
#if !defined(_MSC_VER)
void fill(float16x4_t _v);
void fill(float16x8_t _v);
#endif
#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
#endif // __ARM_NEON
#if __SSE2__
@@ -138,9 +138,9 @@ public:
void fill(vfloat32m1_t _v);
void fill(vuint16m1_t _v);
void fill(vint8m1_t _v);
#if __riscv_zfh
#if __riscv_zvfh
void fill(vfloat16m1_t _v);
#endif // __riscv_zfh
#endif // __riscv_zvfh
#endif // __riscv_vector
template<typename T>
void fill(T v);
@@ -963,6 +963,7 @@ NCNN_FORCEINLINE void Mat::fill(uint16x4_t _v)
}
}
#if !defined(_MSC_VER)
NCNN_FORCEINLINE void Mat::fill(int32x4_t _v)
{
int size = (int)total();
@@ -973,6 +974,7 @@ NCNN_FORCEINLINE void Mat::fill(int32x4_t _v)
ptr += 4;
}
}
#endif
NCNN_FORCEINLINE void Mat::fill(int32x4_t _v0, int32x4_t _v1)
{
@@ -986,6 +988,7 @@ NCNN_FORCEINLINE void Mat::fill(int32x4_t _v0, int32x4_t _v1)
}
}
#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
#if !defined(_MSC_VER)
NCNN_FORCEINLINE void Mat::fill(float16x4_t _v)
{
int size = (int)total();
@@ -1007,6 +1010,7 @@ NCNN_FORCEINLINE void Mat::fill(float16x8_t _v)
ptr += 8;
}
}
#endif
#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
#endif // __ARM_NEON
@@ -1085,17 +1089,18 @@ NCNN_FORCEINLINE void Mat::fill(__m128 _v)
}
}
#endif // __loongarch_sx
#if __riscv_vector
NCNN_FORCEINLINE void Mat::fill(vfloat32m1_t _v)
{
const int packn = cpu_riscv_vlenb() / 4;
const size_t vl = vsetvl_e32m1(packn);
const size_t vl = __riscv_vsetvl_e32m1(packn);
int size = (int)total();
float* ptr = (float*)data;
for (int i = 0; i < size; i++)
{
vse32_v_f32m1(ptr, _v, vl);
__riscv_vse32_v_f32m1(ptr, _v, vl);
ptr += packn;
}
}
@@ -1103,13 +1108,13 @@ NCNN_FORCEINLINE void Mat::fill(vfloat32m1_t _v)
NCNN_FORCEINLINE void Mat::fill(vuint16m1_t _v)
{
const int packn = cpu_riscv_vlenb() / 2;
const size_t vl = vsetvl_e16m1(packn);
const size_t vl = __riscv_vsetvl_e16m1(packn);
int size = (int)total();
unsigned short* ptr = (unsigned short*)data;
for (int i = 0; i < size; i++)
{
vse16_v_u16m1(ptr, _v, vl);
__riscv_vse16_v_u16m1(ptr, _v, vl);
ptr += packn;
}
}
@@ -1117,31 +1122,31 @@ NCNN_FORCEINLINE void Mat::fill(vuint16m1_t _v)
NCNN_FORCEINLINE void Mat::fill(vint8m1_t _v)
{
const int packn = cpu_riscv_vlenb() / 1;
const size_t vl = vsetvl_e8m1(packn);
const size_t vl = __riscv_vsetvl_e8m1(packn);
int size = (int)total();
signed char* ptr = (signed char*)data;
for (int i = 0; i < size; i++)
{
vse8_v_i8m1(ptr, _v, vl);
__riscv_vse8_v_i8m1(ptr, _v, vl);
ptr += packn;
}
}
#if __riscv_zfh
#if __riscv_zvfh
NCNN_FORCEINLINE void Mat::fill(vfloat16m1_t _v)
{
const int packn = cpu_riscv_vlenb() / 2;
const size_t vl = vsetvl_e16m1(packn);
const size_t vl = __riscv_vsetvl_e16m1(packn);
int size = (int)total();
__fp16* ptr = (__fp16*)data;
for (int i = 0; i < size; i++)
{
vse16_v_f16m1(ptr, _v, vl);
__riscv_vse16_v_f16m1(ptr, _v, vl);
ptr += packn;
}
}
#endif // __riscv_zfh
#endif // __riscv_zvfh
#endif // __riscv_vector
template<typename T>

View File

@@ -33,6 +33,7 @@
# define NCNN_DEPRECATED_NO_EXPORT NCNN_NO_EXPORT NCNN_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef NCNN_NO_DEPRECATED
# define NCNN_NO_DEPRECATED

View File

@@ -182,9 +182,8 @@ public:
// enabled by default
void set_light_mode(bool enable);
// set thread count for this extractor
// this will overwrite the global setting
// default count is system depended
// deprecated, no-op
// instead, set net.opt.num_threads before net.load_param()
void set_num_threads(int num_threads);
// set blob memory allocator
@@ -194,6 +193,8 @@ public:
void set_workspace_allocator(Allocator* allocator);
#if NCNN_VULKAN
// deprecated, no-op
// instead, set net.opt.use_vulkan_compute before net.load_param()
void set_vulkan_compute(bool enable);
void set_blob_vkallocator(VkAllocator* allocator);

View File

@@ -144,8 +144,10 @@ public:
// but you can force this on/off if you wish
bool use_a53_a55_optimized_kernel;
bool use_reserved_7;
bool use_reserved_8;
// enable options for shared variables in gpu shader
bool use_fp16_uniform;
bool use_int8_uniform;
bool use_reserved_9;
bool use_reserved_10;
bool use_reserved_11;

View File

@@ -19,8 +19,6 @@
#include "platform.h"
#if NCNN_VULKAN
#include "gpu.h"
#include <vulkan/vulkan.h>
#endif // NCNN_VULKAN
namespace ncnn {

View File

@@ -17,10 +17,6 @@
#include "platform.h"
#if NCNN_VULKAN
#include <vulkan/vulkan.h>
#endif // NCNN_VULKAN
#include "mat.h"
#include "gpu.h"

View File

@@ -30,6 +30,7 @@
#define NCNN_PIXEL_AFFINE 1
#define NCNN_PIXEL_DRAWING 1
#define NCNN_VULKAN 0
#define NCNN_SIMPLEVK 1
#define NCNN_SYSTEM_GLSLANG 0
#define NCNN_RUNTIME_CPU 1
#define NCNN_GNU_INLINE_ASM 1
@@ -39,6 +40,9 @@
#define NCNN_F16C 0
#define NCNN_AVX2 0
#define NCNN_AVXVNNI 0
#define NCNN_AVXVNNIINT8 0
#define NCNN_AVXVNNIINT16 0
#define NCNN_AVXNECONVERT 0
#define NCNN_AVX512 0
#define NCNN_AVX512VNNI 0
#define NCNN_AVX512BF16 0
@@ -58,18 +62,21 @@
#define NCNN_LSX 0
#define NCNN_MMI 0
#define NCNN_RVV 0
#define NCNN_ZFH 0
#define NCNN_ZVFH 0
#define NCNN_XTHEADVECTOR 0
#define NCNN_INT8 1
#define NCNN_BF16 1
#define NCNN_FORCE_INLINE 1
#define NCNN_VERSION_STRING "1.0.20231027"
#define NCNN_VERSION_STRING "1.0.20241226"
#include "ncnn_export.h"
#ifdef __cplusplus
#if NCNN_THREADS
#if (defined _WIN32 && !(defined __MINGW32__))
#if defined _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
@@ -85,7 +92,7 @@
namespace ncnn {
#if NCNN_THREADS
#if (defined _WIN32 && !(defined __MINGW32__))
#if defined _WIN32
class NCNN_EXPORT Mutex
{
public:
@@ -140,7 +147,7 @@ public:
private:
DWORD key;
};
#else // (defined _WIN32 && !(defined __MINGW32__))
#else // defined _WIN32
class NCNN_EXPORT Mutex
{
public:
@@ -185,7 +192,7 @@ public:
private:
pthread_key_t key;
};
#endif // (defined _WIN32 && !(defined __MINGW32__))
#endif // defined _WIN32
#else // NCNN_THREADS
class NCNN_EXPORT Mutex
{
@@ -235,6 +242,28 @@ private:
Mutex& mutex;
};
static inline void swap_endianness_16(void* x)
{
unsigned char* xx = (unsigned char*)x;
unsigned char x0 = xx[0];
unsigned char x1 = xx[1];
xx[0] = x1;
xx[1] = x0;
}
static inline void swap_endianness_32(void* x)
{
unsigned char* xx = (unsigned char*)x;
unsigned char x0 = xx[0];
unsigned char x1 = xx[1];
unsigned char x2 = xx[2];
unsigned char x3 = xx[3];
xx[0] = x3;
xx[1] = x2;
xx[2] = x1;
xx[3] = x0;
}
} // namespace ncnn
#if NCNN_SIMPLESTL
@@ -254,6 +283,15 @@ private:
#include <fenv.h>
#endif
#if NCNN_VULKAN
#if NCNN_SIMPLEVK
#include "simplevk.h"
#else
#include <vulkan/vulkan.h>
#endif
#include "vulkan_header_fix.h"
#endif // NCNN_VULKAN
#endif // __cplusplus
#if NCNN_STDIO

View File

@@ -79,6 +79,7 @@ NCNN_EXPORT float log10f(float);
* ====================================================
*/
NCNN_EXPORT float erf(float);
NCNN_EXPORT float erff(float);
NCNN_EXPORT float erfcf(float);
/*
@@ -99,4 +100,4 @@ NCNN_EXPORT float nearbyintf(float);
#endif // NCNN_SIMPLEMATH
#endif // NCNN_SIMPLEMATH_H
#endif // NCNN_SIMPLEMATH_H

View File

@@ -398,13 +398,13 @@ struct NCNN_EXPORT Mat
template<typename _Tp>
const _Tp* ptr(int y) const
{
return (const _Tp*)data + y * cols * c;
return (const _Tp*)(data + y * cols * c);
}
template<typename _Tp>
_Tp* ptr(int y)
{
return (_Tp*)data + y * cols * c;
return (_Tp*)(data + y * cols * c);
}
// roi

View File

@@ -15,6 +15,7 @@
#ifndef __OMP_H
# define __OMP_H
# include <stddef.h>
# include <stdlib.h>
# include <stdint.h>
@@ -141,17 +142,112 @@
extern int __KAI_KMPC_CONVENTION omp_get_initial_device (void);
extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int);
extern void __KAI_KMPC_CONVENTION omp_target_free(void *, int);
extern int __KAI_KMPC_CONVENTION omp_target_is_present(void *, int);
extern int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int);
extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *,
extern int __KAI_KMPC_CONVENTION omp_target_is_present(const void *, int);
extern int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
const size_t *, const size_t *, const size_t *, const size_t *, int, int);
extern int __KAI_KMPC_CONVENTION omp_target_associate_ptr(void *, void *, size_t, size_t, int);
extern int __KAI_KMPC_CONVENTION omp_target_disassociate_ptr(void *, int);
extern int __KAI_KMPC_CONVENTION omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
extern int __KAI_KMPC_CONVENTION omp_target_disassociate_ptr(const void *, int);
/* OpenMP 5.0 */
extern int __KAI_KMPC_CONVENTION omp_get_device_num (void);
typedef void * omp_depend_t;
/* OpenMP 5.1 interop */
typedef intptr_t omp_intptr_t;
/* 0..omp_get_num_interop_properties()-1 are reserved for implementation-defined properties */
typedef enum omp_interop_property {
omp_ipr_fr_id = -1,
omp_ipr_fr_name = -2,
omp_ipr_vendor = -3,
omp_ipr_vendor_name = -4,
omp_ipr_device_num = -5,
omp_ipr_platform = -6,
omp_ipr_device = -7,
omp_ipr_device_context = -8,
omp_ipr_targetsync = -9,
omp_ipr_first = -9
} omp_interop_property_t;
#define omp_interop_none 0
typedef enum omp_interop_rc {
omp_irc_no_value = 1,
omp_irc_success = 0,
omp_irc_empty = -1,
omp_irc_out_of_range = -2,
omp_irc_type_int = -3,
omp_irc_type_ptr = -4,
omp_irc_type_str = -5,
omp_irc_other = -6
} omp_interop_rc_t;
typedef enum omp_interop_fr {
omp_ifr_cuda = 1,
omp_ifr_cuda_driver = 2,
omp_ifr_opencl = 3,
omp_ifr_sycl = 4,
omp_ifr_hip = 5,
omp_ifr_level_zero = 6,
omp_ifr_last = 7
} omp_interop_fr_t;
typedef void * omp_interop_t;
/*!
* The `omp_get_num_interop_properties` routine retrieves the number of implementation-defined properties available for an `omp_interop_t` object.
*/
extern int __KAI_KMPC_CONVENTION omp_get_num_interop_properties(const omp_interop_t);
/*!
* The `omp_get_interop_int` routine retrieves an integer property from an `omp_interop_t` object.
*/
extern omp_intptr_t __KAI_KMPC_CONVENTION omp_get_interop_int(const omp_interop_t, omp_interop_property_t, int *);
/*!
* The `omp_get_interop_ptr` routine retrieves a pointer property from an `omp_interop_t` object.
*/
extern void * __KAI_KMPC_CONVENTION omp_get_interop_ptr(const omp_interop_t, omp_interop_property_t, int *);
/*!
* The `omp_get_interop_str` routine retrieves a string property from an `omp_interop_t` object.
*/
extern const char * __KAI_KMPC_CONVENTION omp_get_interop_str(const omp_interop_t, omp_interop_property_t, int *);
/*!
* The `omp_get_interop_name` routine retrieves a property name from an `omp_interop_t` object.
*/
extern const char * __KAI_KMPC_CONVENTION omp_get_interop_name(const omp_interop_t, omp_interop_property_t);
/*!
* The `omp_get_interop_type_desc` routine retrieves a description of the type of a property associated with an `omp_interop_t` object.
*/
extern const char * __KAI_KMPC_CONVENTION omp_get_interop_type_desc(const omp_interop_t, omp_interop_property_t);
/*!
* The `omp_get_interop_rc_desc` routine retrieves a description of the return code associated with an `omp_interop_t` object.
*/
extern const char * __KAI_KMPC_CONVENTION omp_get_interop_rc_desc(const omp_interop_t, omp_interop_rc_t);
/* OpenMP 5.1 device memory routines */
/*!
* The `omp_target_memcpy_async` routine asynchronously performs a copy between any combination of host and device pointers.
*/
extern int __KAI_KMPC_CONVENTION omp_target_memcpy_async(void *, const void *, size_t, size_t, size_t, int,
int, int, omp_depend_t *);
/*!
* The `omp_target_memcpy_rect_async` routine asynchronously performs a copy between any combination of host and device pointers.
*/
extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect_async(void *, const void *, size_t, int, const size_t *,
const size_t *, const size_t *, const size_t *, const size_t *, int, int,
int, omp_depend_t *);
/* OpenMP 6.0 device memory routines */
extern void * __KAI_KMPC_CONVENTION omp_target_memset(void *, int, size_t, int);
extern void * __KAI_KMPC_CONVENTION omp_target_memset_async(void *, int, size_t, int, int, omp_depend_t *);
/*!
* The `omp_get_mapped_ptr` routine returns the device pointer that is associated with a host pointer for a given device.
*/
extern void * __KAI_KMPC_CONVENTION omp_get_mapped_ptr(const void *, int);
extern int __KAI_KMPC_CONVENTION omp_target_is_accessible(const void *, size_t, int);
/* kmp API functions */
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
@@ -228,7 +324,7 @@
typedef uintptr_t omp_uintptr_t;
typedef enum {
omp_atk_threadmodel = 1,
omp_atk_sync_hint = 1,
omp_atk_alignment = 2,
omp_atk_access = 3,
omp_atk_pool_size = 4,
@@ -241,10 +337,10 @@
typedef enum {
omp_atv_false = 0,
omp_atv_true = 1,
omp_atv_default = 2,
omp_atv_contended = 3,
omp_atv_uncontended = 4,
omp_atv_sequential = 5,
omp_atv_serialized = 5,
omp_atv_sequential = omp_atv_serialized, // (deprecated)
omp_atv_private = 6,
omp_atv_all = 7,
omp_atv_thread = 8,
@@ -259,6 +355,7 @@
omp_atv_blocked = 17,
omp_atv_interleaved = 18
} omp_alloctrait_value_t;
#define omp_atv_default ((omp_uintptr_t)-1)
typedef struct {
omp_alloctrait_key_t key;
@@ -277,12 +374,19 @@
extern __KMP_IMP omp_allocator_handle_t const omp_cgroup_mem_alloc;
extern __KMP_IMP omp_allocator_handle_t const omp_pteam_mem_alloc;
extern __KMP_IMP omp_allocator_handle_t const omp_thread_mem_alloc;
extern __KMP_IMP omp_allocator_handle_t const llvm_omp_target_host_mem_alloc;
extern __KMP_IMP omp_allocator_handle_t const llvm_omp_target_shared_mem_alloc;
extern __KMP_IMP omp_allocator_handle_t const llvm_omp_target_device_mem_alloc;
typedef omp_uintptr_t omp_memspace_handle_t;
extern __KMP_IMP omp_memspace_handle_t const omp_default_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_large_cap_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_const_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_high_bw_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_low_lat_mem_space;
extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_host_mem_space;
extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_shared_mem_space;
extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_device_mem_space;
# else
# if __cplusplus >= 201103
typedef enum omp_allocator_handle_t : omp_uintptr_t
@@ -299,6 +403,9 @@
omp_cgroup_mem_alloc = 6,
omp_pteam_mem_alloc = 7,
omp_thread_mem_alloc = 8,
llvm_omp_target_host_mem_alloc = 100,
llvm_omp_target_shared_mem_alloc = 101,
llvm_omp_target_device_mem_alloc = 102,
KMP_ALLOCATOR_MAX_HANDLE = UINTPTR_MAX
} omp_allocator_handle_t;
# if __cplusplus >= 201103
@@ -312,6 +419,9 @@
omp_const_mem_space = 2,
omp_high_bw_mem_space = 3,
omp_low_lat_mem_space = 4,
llvm_omp_target_host_mem_space = 100,
llvm_omp_target_shared_mem_space = 101,
llvm_omp_target_device_mem_space = 102,
KMP_MEMSPACE_MAX_HANDLE = UINTPTR_MAX
} omp_memspace_handle_t;
# endif
@@ -323,9 +433,25 @@
extern omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_get_default_allocator(void);
# ifdef __cplusplus
extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a = omp_null_allocator);
extern void *__KAI_KMPC_CONVENTION omp_aligned_alloc(size_t align, size_t size,
omp_allocator_handle_t a = omp_null_allocator);
extern void *__KAI_KMPC_CONVENTION omp_calloc(size_t nmemb, size_t size,
omp_allocator_handle_t a = omp_null_allocator);
extern void *__KAI_KMPC_CONVENTION omp_aligned_calloc(size_t align, size_t nmemb, size_t size,
omp_allocator_handle_t a = omp_null_allocator);
extern void *__KAI_KMPC_CONVENTION omp_realloc(void *ptr, size_t size,
omp_allocator_handle_t allocator = omp_null_allocator,
omp_allocator_handle_t free_allocator = omp_null_allocator);
extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, omp_allocator_handle_t a = omp_null_allocator);
# else
extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a);
extern void *__KAI_KMPC_CONVENTION omp_aligned_alloc(size_t align, size_t size,
omp_allocator_handle_t a);
extern void *__KAI_KMPC_CONVENTION omp_calloc(size_t nmemb, size_t size, omp_allocator_handle_t a);
extern void *__KAI_KMPC_CONVENTION omp_aligned_calloc(size_t align, size_t nmemb, size_t size,
omp_allocator_handle_t a);
extern void *__KAI_KMPC_CONVENTION omp_realloc(void *ptr, size_t size, omp_allocator_handle_t allocator,
omp_allocator_handle_t free_allocator);
extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a);
# endif
@@ -355,9 +481,30 @@
extern int __KAI_KMPC_CONVENTION omp_get_supported_active_levels(void);
/* OpenMP 5.1 */
extern void __KAI_KMPC_CONVENTION omp_set_num_teams(int num_teams);
extern int __KAI_KMPC_CONVENTION omp_get_max_teams(void);
extern void __KAI_KMPC_CONVENTION omp_set_teams_thread_limit(int limit);
extern int __KAI_KMPC_CONVENTION omp_get_teams_thread_limit(void);
/* OpenMP 5.1 Display Environment */
extern void omp_display_env(int verbose);
# if defined(_OPENMP) && _OPENMP >= 201811
#pragma omp begin declare variant match(device={kind(host)})
static inline int omp_is_initial_device(void) { return 1; }
#pragma omp end declare variant
#pragma omp begin declare variant match(device={kind(nohost)})
static inline int omp_is_initial_device(void) { return 0; }
#pragma omp end declare variant
# endif
/* OpenMP 5.2 */
extern int __KAI_KMPC_CONVENTION omp_in_explicit_task(void);
/* LLVM Extensions */
extern void *llvm_omp_target_dynamic_shared_alloc(void);
# undef __KAI_KMPC_CONVENTION
# undef __KMP_IMP

View File

@@ -7,9 +7,9 @@
<key>CFBundleIdentifier</key>
<string>org.llvm.openmp</string>
<key>CFBundleVersion</key>
<string>11.0</string>
<string>18.1</string>
<key>CFBundleShortVersionString</key>
<string>11.0</string>
<string>18.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundlePackageType</key>