We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac1a064 commit 5dae47eCopy full SHA for 5dae47e
15 files changed
tests/modules/language/ascendc/test.lua
@@ -1,6 +1,6 @@
1
import("core.language.language")
2
3
-local function _write_asc_file(name, source)
+function _write_asc_file(name, source)
4
local sourcefile = os.tmpfile(name) .. ".asc"
5
io.writefile(sourcefile, source)
6
return sourcefile
@@ -16,8 +16,7 @@ function test_check_main(t)
16
local mainfile = _write_asc_file("ascendc_check_main", [[
17
#include "acl/acl.h"
18
19
-int32_t main(int argc, char const *argv[])
20
-{
+int32_t main(int argc, char const *argv[]) {
21
return 0;
22
}
23
]])
@@ -28,8 +27,7 @@ int32_t main(int argc, char const *argv[])
28
27
/*
29
int main() { return 1; }
30
*/
31
-__global__ __vector__ void kernel()
32
+__global__ __vector__ void kernel() {
33
34
35
t:are_equal(check_main(commentfile), false)
tests/projects/ascendc/libs/src/lib.asc
@@ -1,6 +1,5 @@
#include "kernel_operator.h"
-__global__ __vector__ void hello_world()
+__global__ __vector__ void hello_world() {
AscendC::printf("[Block (%lu/%lu)]: Hello World!!!\n", AscendC::GetBlockIdx(), AscendC::GetBlockNum());
tests/projects/ascendc/libs/src/main.asc
@@ -3,8 +3,7 @@
extern __global__ __vector__ void hello_world();
7
8
aclInit(nullptr);
9
int32_t deviceId = 0;
10
aclrtSetDevice(deviceId);
tests/projects/ascendc/libs/xmake.lua
@@ -2,19 +2,16 @@ add_rules("mode.debug", "mode.release")
target("ascendc_static")
set_kind("static")
- set_toolchains("ascendc")
add_files("src/lib.asc")
add_ascnpuarchs("dav-2201")
target("ascendc_shared")
set_kind("shared")
11
12
13
14
15
target("ascendc_libs_bin")
add_deps("ascendc_static", "ascendc_shared")
set_kind("binary")
add_files("src/main.asc")
tests/projects/ascendc/mixed_binary/src/helper.aicpu
@@ -1,7 +1,6 @@
#include "aicpu_api.h"
-__global__ __aicpu__ uint32_t hello_world(void *args)
+__global__ __aicpu__ uint32_t hello_world(void *args) {
AscendC::printf("Hello World!!!\n");
tests/projects/ascendc/mixed_binary/src/main.asc
@@ -6,8 +6,7 @@ struct KernelArgs {
extern __global__ __aicpu__ uint32_t hello_world(void *args);
xmake/languages/ascendc/check_main.lua
@@ -26,7 +26,7 @@ function main(sourcefile)
26
-- remove comment first
sourcecode = sourcecode:gsub("/%*.-%*/", "")
- sourcecode = sourcecode:gsub("//.-\n", "\n")
+ sourcecode = sourcecode:gsub("//[^\n]*", "")
-- find int main(int argc, char** argv) {}
if sourcecode:find("%s+main%s*%(.-%)") then
xmake/modules/core/tools/bisheng.lua
@@ -27,6 +27,11 @@ function init(self)
self:add("ascflags", "-Qunused-arguments")
self:add("aicpuflags", "-Qunused-arguments")
self:set("ascshflags", "-shared")
+ -- default C++ standard and source kind for bisheng compiler driver
+ self:add("ascflags", "-std=c++17", {force = true})
+ self:add("aicpuflags", "-std=c++17", {force = true})
+ self:add("ascflags", "-x", "asc", {force = true})
+ self:add("aicpuflags", "-x", "aicpu", {force = true})
end
36
37
-- make the language flag
xmake/modules/core/tools/bisheng/has_flags.lua
@@ -133,7 +133,7 @@ function _check_try_running(flags, opt, islinker)
133
local snippet = opt.snippet or
134
"int main(int argc, char** argv)\n{return 0;}\n"
135
local sourcekind = _get_sourcekind(opt, islinker)
136
- local sourcefile = os.tmpfile("bisheng_has_flags:" .. snippet) ..
+ local sourcefile = os.tmpfile("bisheng_has_flags") ..
137
_get_extension(sourcekind)
138
if not os.isfile(sourcefile) then
139
io.writefile(sourcefile, snippet)
xmake/platforms/linux/xmake.lua
@@ -45,8 +45,6 @@ platform("linux")
45
{category = "Cuda SDK Configuration" }
46
, {nil, "cuda", "kv", "auto", "The Cuda SDK Directory" }
47
, {nil, "cuda_sdkver", "kv", "auto", "The Cuda SDK Version" }
48
- , {category = "Ascend CANN SDK Configuration" }
49
- , {nil, "ascendc", "kv", "auto", "The Ascend CANN SDK Directory" }
50
, {category = "Qt SDK Configuration" }
51
, {nil, "qt", "kv", "auto", "The Qt SDK Directory" }
52
, {nil, "qt_host", "kv", "auto", "The Qt Host SDK Directory" }
@@ -59,8 +57,6 @@ platform("linux")
59
57
{
60
58
61
62
63
64
65
66
0 commit comments