Multi-Threading w/ MEX: Adding Two Vectors

버전 1.0.0 (5.95 KB) 작성자: oreoman
A basic MEX function that adds two vectors together, but utilizes multiple threads. Created as a way to learn MEX multi-threading.
다운로드 수: 39
업데이트 2019/2/27

라이선스 보기

In order to optimize certain pieces of a simulation, I tried to build out a multi-threaded algorithm for solving certain linear algebra problems that I couldn't find good solutions to in various libraries or that couldn't be vectorized in proper MATLAB code.

Since I found a lot of the tutorials available online very confusing, once I figured things out I thought it would be handy to share what I learned. With thanks to Yair Altman and his multi-threading example from 2018 that included all of the information I needed to finally figure things out:

https://undocumentedmatlab.com/blog/multi-threaded-mex

To add non-Windows compatibility, you can add in pthreads by following along with Yair's example.

This needs to be compiled with the command, "mex -R2018a madd.cpp"

인용 양식

oreoman (2026). Multi-Threading w/ MEX: Adding Two Vectors (https://kr.mathworks.com/matlabcentral/fileexchange/70406-multi-threading-w-mex-adding-two-vectors), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2018b
R2018a 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 MATLAB Algorithm Acceleration에 대해 자세히 알아보기
태그 태그 추가
mex
버전 게시됨 릴리스 정보
1.0.0