@@ -27,7 +27,8 @@ function addSampleToTraceLowered(
27
27
elseif datatype_width == 64
28
28
Float64
29
29
else
30
- error (" Unsupported datatype width: $datatype_width " )
30
+ @ccall printf (" Unsupported datatype width: %d\n " :: Cstring , datatype_width:: Cint ):: Cvoid
31
+ return nothing
31
32
end
32
33
33
34
typed_ptr = Ptr {julia_type} (sample_ptr)
65
66
(),
66
67
string (f),
67
68
false ;
69
+ do_transpose= false ,
68
70
args_in_result= :all ,
69
71
argprefix,
70
72
resprefix,
97
99
resv = MLIR. IR. result (gen_op, i)
98
100
if TracedUtils. has_idx (res, resprefix)
99
101
path = TracedUtils. get_idx (res, resprefix)
100
- TracedUtils. set! (result, path[2 : end ], TracedUtils . transpose_val ( resv) )
102
+ TracedUtils. set! (result, path[2 : end ], resv)
101
103
elseif TracedUtils. has_idx (res, argprefix)
102
104
idx, path = TracedUtils. get_argidx (res, argprefix)
103
105
if idx == 1 && fnwrap
104
- TracedUtils. set! (f, path[3 : end ], TracedUtils . transpose_val ( resv) )
106
+ TracedUtils. set! (f, path[3 : end ], resv)
105
107
else
106
108
if fnwrap
107
109
idx -= 1
108
110
end
109
- TracedUtils. set! (args[idx], path[3 : end ], TracedUtils . transpose_val ( resv) )
111
+ TracedUtils. set! (args[idx], path[3 : end ], resv)
110
112
end
111
113
else
112
- TracedUtils. set! (res, (), TracedUtils . transpose_val ( resv) )
114
+ TracedUtils. set! (res, (), resv)
113
115
end
114
116
end
115
117
130
132
(),
131
133
string (f),
132
134
false ;
135
+ do_transpose= false ,
133
136
args_in_result= :all ,
134
- do_transpose= false , # TODO : double check transpose
135
137
argprefix,
136
138
resprefix,
137
139
resargprefix,
@@ -177,19 +179,19 @@ end
177
179
resv = MLIR. IR. result (sample_op, i)
178
180
if TracedUtils. has_idx (res, resprefix)
179
181
path = TracedUtils. get_idx (res, resprefix)
180
- TracedUtils. set! (result, path[2 : end ], TracedUtils . transpose_val ( resv) )
182
+ TracedUtils. set! (result, path[2 : end ], resv)
181
183
elseif TracedUtils. has_idx (res, argprefix)
182
184
idx, path = TracedUtils. get_argidx (res, argprefix)
183
185
if idx == 1 && fnwrap
184
- TracedUtils. set! (f, path[3 : end ], TracedUtils . transpose_val ( resv) )
186
+ TracedUtils. set! (f, path[3 : end ], resv)
185
187
else
186
188
if fnwrap
187
189
idx -= 1
188
190
end
189
- TracedUtils. set! (args[idx], path[3 : end ], TracedUtils . transpose_val ( resv) )
191
+ TracedUtils. set! (args[idx], path[3 : end ], resv)
190
192
end
191
193
else
192
- TracedUtils. set! (res, (), TracedUtils . transpose_val ( resv) )
194
+ TracedUtils. set! (res, (), resv)
193
195
end
194
196
end
195
197
210
212
(),
211
213
string (f),
212
214
false ;
215
+ do_transpose= false ,
213
216
args_in_result= :all ,
214
217
argprefix,
215
218
resprefix,
@@ -246,19 +249,19 @@ end
246
249
resv = MLIR. IR. result (simulate_op, i)
247
250
if TracedUtils. has_idx (res, resprefix)
248
251
path = TracedUtils. get_idx (res, resprefix)
249
- TracedUtils. set! (result, path[2 : end ], TracedUtils . transpose_val ( resv) )
252
+ TracedUtils. set! (result, path[2 : end ], resv)
250
253
elseif TracedUtils. has_idx (res, argprefix)
251
254
idx, path = TracedUtils. get_argidx (res, argprefix)
252
255
if idx == 1 && fnwrap
253
- TracedUtils. set! (f, path[3 : end ], TracedUtils . transpose_val ( resv) )
256
+ TracedUtils. set! (f, path[3 : end ], resv)
254
257
else
255
258
if fnwrap
256
259
idx -= 1
257
260
end
258
- TracedUtils. set! (args[idx], path[3 : end ], TracedUtils . transpose_val ( resv) )
261
+ TracedUtils. set! (args[idx], path[3 : end ], resv)
259
262
end
260
263
else
261
- TracedUtils. set! (res, (), TracedUtils . transpose_val ( resv) )
264
+ TracedUtils. set! (res, (), resv)
262
265
end
263
266
end
264
267
@@ -271,7 +274,7 @@ function print_trace(trace::Dict{Symbol,Any})
271
274
println (" $symbol :" )
272
275
println (" Sample: $(sample) " )
273
276
end
274
- println (" ### End of Trace ###" )
277
+ return println (" ### End of Trace ###" )
275
278
end
276
279
277
280
end
0 commit comments