random_sample.h 930 Bytes
Newer Older
PanZezhong's avatar
PanZezhong committed
1
2
#ifndef __INFINIOP_RANDOM_SAMPLE_API_H__
#define __INFINIOP_RANDOM_SAMPLE_API_H__
PanZezhongQY's avatar
PanZezhongQY committed
3

PanZezhong's avatar
PanZezhong committed
4
#include "../operator_descriptor.h"
PanZezhongQY's avatar
PanZezhongQY committed
5
6
7

typedef InfiniopDescriptor *infiniopRandomSampleDescriptor_t;

8
9
10
11
12
__C __export infiniStatus_t infiniopCreateRandomSampleDescriptor(
    infiniopHandle_t handle,
    infiniopRandomSampleDescriptor_t *desc_ptr,
    infiniopTensorDescriptor_t result,
    infiniopTensorDescriptor_t probs);
PanZezhongQY's avatar
PanZezhongQY committed
13

14
15
16
__C __export infiniStatus_t infiniopGetRandomSampleWorkspaceSize(
    infiniopRandomSampleDescriptor_t desc,
    size_t *size);
PanZezhongQY's avatar
PanZezhongQY committed
17

18
19
20
21
22
23
24
25
26
27
28
__C __export infiniStatus_t infiniopRandomSample(
    infiniopRandomSampleDescriptor_t desc,
    void *workspace,
    size_t workspace_size,
    void *result,
    const void *probs,
    float random_val,
    float topp,
    int topk,
    float temperature,
    void *stream);
PanZezhongQY's avatar
PanZezhongQY committed
29

30
31
__C __export infiniStatus_t infiniopDestroyRandomSampleDescriptor(
    infiniopRandomSampleDescriptor_t desc);
PanZezhongQY's avatar
PanZezhongQY committed
32
33

#endif