Resolve WES-90 "Integrate signpredictor in courses"

This commit is contained in:
Louis Adriaens
2023-03-18 19:53:17 +00:00
committed by Jerome Coudron
parent 1a75791d62
commit 746906294b
463 changed files with 99422 additions and 1187 deletions

View File

@@ -0,0 +1,13 @@
{
"name": "Unity.Barracuda.iOSBLAS",
"references": [
"Unity.Barracuda"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor",
"iOS"
],
"excludePlatforms": [],
"allowUnsafeCode": true
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 005937e819cd540429ad05eabcfb642f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,73 @@
#if UNITY_IOS
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Scripting;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
[assembly: AlwaysLinkAssembly]
namespace Unity.Barracuda {
[Preserve]
public class iOSBLAS : BLASPlugin
{
[DllImport("__Internal")]
static extern unsafe void iossgemm(float* Ap, int AM, int AN,
float* Bp, int BM, int BN,
float* Cp, int CM, int CN,
int bs, bool transposeA, bool transposeB);
public bool IsNative()
{
return true;
}
public bool IsCurrentPlatformSupported()
{
return Application.platform == RuntimePlatform.IPhonePlayer;
}
public unsafe void SGEMM(float* Ap, int AM, int AN, float* Bp, int BM, int BN, float* Cp, int CM, int CN, int bs,
bool transposeA = false, bool transposeB = false)
{
iossgemm(Ap, AM, AN, Bp, BM, BN, Cp, CM, CN, bs, transposeA, transposeB);
}
public unsafe JobHandle ScheduleSGEMM(JobHandle dependsOn,
float* Ap, int AM, int AN, float* Bp, int BM, int BN, float* Cp, int CM, int CN,
int bs,
bool transposeA = false, bool transposeB = false)
{
var job = new SGEMMJob();
job.Ap = Ap; job.AM = AM; job.AN = AN;
job.Bp = Bp; job.BM = BM; job.BN = BN;
job.Cp = Cp; job.CM = CM; job.CN = CN;
job.transposeA = transposeA;
job.transposeB = transposeB;
job.bs = bs;
return job.Schedule(dependsOn);
}
unsafe struct SGEMMJob : IJob
{
[NativeDisableUnsafePtrRestriction][ReadOnly] public unsafe float* Ap;
public int AM, AN;
[NativeDisableUnsafePtrRestriction][ReadOnly] public unsafe float* Bp;
public int BM, BN;
[NativeDisableUnsafePtrRestriction] public unsafe float* Cp;
public int CM, CN;
public int bs;
public bool transposeA;
public bool transposeB;
public void Execute()
{
iossgemm(Ap, AM, AN, Bp, BM, BN, Cp, CM, CN, bs, transposeA, transposeB);
}
}
}
}
#endif // UNITY_IOS

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 75424b0c6afc14ea7a1debef68240d9e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
#import <Accelerate/Accelerate.h>
extern "C"
{
void iossgemm(float* Ap, int AM, int AN,
float* Bp, int BM, int BN,
float* Cp, int CM, int CN,
int bs, bool transposeA, bool transposeB)
{
cblas_sgemm(CblasRowMajor, transposeA ? CblasTrans : CblasNoTrans,
transposeB ? CblasTrans : CblasNoTrans,
AM, BN, BM, 1.0f, Ap, AN, Bp, BN, 1.0f, Cp, CN);
}
}

View File

@@ -0,0 +1,102 @@
fileFormatVersion: 2
guid: 100b08f95d9f349118f287b0170140d4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies: Accelerate;
- first:
tvOS: tvOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant: