Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMetalSpectrogram.hpp
More file actions
Latest commit
33 lines (27 loc) · 1.09 KB
/
Copy pathMetalSpectrogram.hpp
File metadata and controls
33 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// gpu_spectrogram.h
// audio_test
//
// Created by Alex on 25.04.2020.
// Copyright © 2020 Alex. All rights reserved.
//
#ifndef gpu_spectrogram_h
#definegpu_spectrogram_h
#include"BaseSpectrogram.hpp"
#include"_MetalSpectrogram.hpp"
#include"NSObjectCPPProxy.hpp"
#include<complex>
template <typename Input, unsignedint size, unsignedint nfft, unsignedint noverlap>
classMetalSpectrogram: publicBaseSpectrogram<Input, size, nfft, noverlap>, protected NSObjectCPPProxy{
typedef BaseSpectrogram<Input, size, nfft, noverlap> Base;
usingtypename Base::Output;
public:
MetalSpectrogram(constvoid* gpu): BaseSpectrogram<Input, size, nfft, noverlap>(), NSObjectCPPProxy((__bridge void *)[[_MetalSpectrogram alloc] initWithDevice:(__bridge id<MTLDevice>)gpu inputType: Base::inputType andSCP: Base::scp]){}
Output calculate(const Tensor<Input, size>& input) override{
Output output;
auto spectrogram = (__bridge _MetalSpectrogram*)ptr;
[spectrogram compute: input.value output:output.value];
return output;
}
};
#endif/* gpu_spectrogram_h */