Skip to content

Commit ee14e29

Browse files
committed
Async kernel function generation no longer requires buffers in JSON sig
1 parent c2a87f4 commit ee14e29

File tree

3 files changed

+18
-28
lines changed

3 files changed

+18
-28
lines changed

tools/intermediate-data/all_signatures.json tools/intermediate-data/inter_signatures.json

+1-26
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,7 @@
88
{
99
"name": "hls_abort",
1010
"returnType": "void",
11-
"parameters": [
12-
{
13-
"name": "buf",
14-
"type": "int8_t*"
15-
},
16-
{
17-
"name": "info",
18-
"type": "hls_async_info*"
19-
},
20-
{
21-
"name": "is_last",
22-
"type": "bool"
23-
}
24-
]
11+
"parameters": []
2512
}
2613
]
2714
},
@@ -163,18 +150,6 @@
163150
"name": "hls_assert",
164151
"returnType": "void",
165152
"parameters": [
166-
{
167-
"name": "buf",
168-
"type": "int8_t*"
169-
},
170-
{
171-
"name": "info",
172-
"type": "hls_async_info*"
173-
},
174-
{
175-
"name": "is_last",
176-
"type": "bool"
177-
},
178153
{
179154
"name": "expression",
180155
"type": "int"

tools/json-to-c/src/AsyncKernelHandler.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FunctionJp, Statement } from "@specs-feup/clava/api/Joinpoints.js";
1+
import { Decl, FunctionJp, Statement } from "@specs-feup/clava/api/Joinpoints.js";
22
import { AHandler } from "./AHandler.js";
33
import ClavaJoinPoints from "@specs-feup/clava/api/clava/ClavaJoinPoints.js";
44

@@ -12,6 +12,21 @@ export class AsyncKernelHandler extends AHandler {
1212
return;
1313
}
1414

15+
protected buildSignature(name: string, returnType: string, parameters: Record<string, string>[]): FunctionJp {
16+
const newParams: Decl[] = [
17+
ClavaJoinPoints.param("buf", ClavaJoinPoints.type("char*")),
18+
ClavaJoinPoints.param("info", ClavaJoinPoints.type("async_kernel_info*")),
19+
ClavaJoinPoints.param("is_last", ClavaJoinPoints.type("bool"))
20+
];
21+
22+
for (const param of parameters) {
23+
newParams.push(ClavaJoinPoints.param(param["name"], ClavaJoinPoints.type(param["type"])));
24+
}
25+
26+
const newFun = ClavaJoinPoints.functionDecl(name, ClavaJoinPoints.type(returnType), ...newParams);
27+
return newFun;
28+
}
29+
1530
protected buildFunctionImpl(signature: Record<string, any>, newSig: FunctionJp): FunctionJp {
1631
const newFun = newSig.copy() as FunctionJp;
1732
const info = newFun.params[1].name;

tools/json-to-c/src/Entrypoint.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { JsonToCConverter } from "./JsonToCConverter.js";
22
import Io from "@specs-feup/lara/api/lara/Io.js";
33

4-
const json = Io.readJson("../intermediate-data/all_signatures.json");
4+
const json = Io.readJson("../intermediate-data/inter_signatures.json");
55
const existingHeaders = ["../intermediate-data/types.h"];
66

77
const converter = new JsonToCConverter();

0 commit comments

Comments
 (0)