summaryrefslogtreecommitdiff
path: root/tests/projects/ascendc/libs/src/main.asc
blob: a8390825cc3c183028dc4a2a6f57c9536906e4be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "kernel_operator.h"
#include "acl/acl.h"

extern __global__ __vector__ void hello_world();

int32_t main(int argc, char const *argv[]) {
    aclInit(nullptr);
    int32_t deviceId = 0;
    aclrtSetDevice(deviceId);
    aclrtStream stream = nullptr;
    aclrtCreateStream(&stream);

    constexpr uint32_t numBlocks = 8;
    hello_world<<<numBlocks, nullptr, stream>>>();
    aclrtSynchronizeStream(stream);

    aclrtDestroyStream(stream);
    aclrtResetDevice(deviceId);
    aclFinalize();
    return 0;
}