argmax for tensors with custom type index and AVX2 optimization (mex)

버전 1.2.0.0 (33 KB) 작성자: Emanuele Ruffaldi
MEX based argmax for tensors supporting user specified type for the resulting index
다운로드 수: 43
업데이트 날짜: 2017/9/3

This MEX function provides the argmax functionality in Matlab for the purpose of avoiding the syntax of the max function from Matlab
[~,Y] = max(X,[],dim)
In addition it allows to return the indices in a user specified type (e.g. int32) and not just the default double.
Speed: when using -march=native in machines with AVX2 it allows interesting speedups in comparison to Matlab (except for double). Using AXV2 256bit registers it is possible to compute the maximum in parallel over elements of 2,4,16 or even 32 for types respectively double,float/int32,int16 and int32. The interesting part is the propagation of the indices because a AVX2 max is trivial. For using this feature it is necessary to pass -march=native to mex (e.g. modifying the XML configuration).

Added comparison of the results using the indices: result from Matlab and this could could differ in indices if the matrix contains duplicate values.

Usage:
Y = argmax(X, dim, int16(0)); % returns indices as int16

TODOs:
- min
- min and max in one pass
- check on dimension and specified type
- remake in C using Python for code generation

인용 양식

Emanuele Ruffaldi (2024). argmax for tensors with custom type index and AVX2 optimization (mex) (https://github.com/eruffaldi/mat_argmax_nd), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Call Python from MATLAB에 대해 자세히 알아보기
태그 태그 추가
mex
도움

받음: ARGMAX/ARGMIN

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.2.0.0

AVX2 optimization: float, double, int32, int16 and int8
Comprehensive testing across types and dimensions with by value verification and speed

1.0.0.0

Better title

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.