Posts

Post marked as solved
4 Replies
2.8k Views
Hi, I would love to code with the Neural Engine on my macbook pro M1 2020. Is there any low-level API to create my very own work-loads? I am working with audio and MIDI. As well sound synthesis and mixing. Can I use the Neural Engine to offload the CPU? I am especially interested in parallelism using threads. My programming lanuage of choice is ANSI C and Objective C.
Posted
by joel2001k.
Last updated
.
Post not yet marked as solved
0 Replies
379 Views
Hi, I have developed and ported a sequencer to Apple macOS. It is written in ANSI C and uses Gtk+-3.0 (Gimp Toolkit) for UI. This toolkit uses some Cocoa specific backend, note there are different backends for different platforms available. After some research I have found this: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html#//apple_ref/doc/uid/TP30000905-CH211-BABCHEEB The function I wanted to use was: thread_policy_set() But the header file doesn't contain it: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h So was it deprecated? Howto do this, nowadays? 		struct task_category_policy tcatpolicy; 		int ret; 		tcatpolicy.role = TASK_FOREGROUND_APPLICATION; 		if((ret = task_policy_set(mach_task_self(), 			TASK_CATEGORY_POLICY, (thread_policy_t)&tcatpolicy, 			TASK_CATEGORY_POLICY_COUNT)) != KERN_SUCCESS) { 			fprintf(stderr, "set_my_task_policy() failed.\n"); 		} Because the UI animation performance is really bad. The threads interfacing CoreAudio are fine. The UI thread is usually the main thread of the process.
Posted
by joel2001k.
Last updated
.