@@ -99,7 +99,7 @@ export autodiff,
9999 make_zero!
100100
101101export jacobian, gradient, gradient!, hvp, hvp!, hvp_and_gradient!
102- export markType, batch_size, onehot, chunkedonehot
102+ export batch_size, onehot, chunkedonehot
103103
104104using LinearAlgebra
105105import SparseArrays
@@ -1446,78 +1446,6 @@ result, ∂v, ∂A
14461446 aug_thunk, adj_thunk
14471447end
14481448
1449- # White lie, should be `Core.LLVMPtr{Cvoid, 0}` but that's not supported by ccallable
1450- Base. @ccallable function __enzyme_float (x:: Ptr{Cvoid} ):: Cvoid
1451- return nothing
1452- end
1453-
1454- Base. @ccallable function __enzyme_double (x:: Ptr{Cvoid} ):: Cvoid
1455- return nothing
1456- end
1457-
1458- @inline function markType (:: Type{T} , ptr:: Ptr{Cvoid} ) where {T}
1459- markType (Base. unsafe_convert (Ptr{T}, ptr))
1460- end
1461-
1462- @inline function markType (data:: Array{T} ) where {T}
1463- GC. @preserve data markType (pointer (data))
1464- end
1465-
1466- # TODO (WM): We record the type of a single index here, we could give it a range
1467- @inline function markType (data:: SubArray )
1468- GC. @preserve data markType (pointer (data))
1469- end
1470-
1471- @inline function markType (data:: Ptr{Float32} )
1472- @static if sizeof (Int) == sizeof (Int64)
1473- Base. llvmcall (
1474- (
1475- " declare void @__enzyme_float(i8* nocapture) nounwind define void @c(i64 %q) nounwind alwaysinline { %p = inttoptr i64 %q to i8* call void @__enzyme_float(i8* %p) ret void }" ,
1476- " c" ,
1477- ),
1478- Cvoid,
1479- Tuple{Ptr{Float32}},
1480- data,
1481- )
1482- else
1483- Base. llvmcall (
1484- (
1485- " declare void @__enzyme_float(i8* nocapture) nounwind define void @c(i32 %q) nounwind alwaysinline { %p = inttoptr i32 %q to i8* call void @__enzyme_float(i8* %p) ret void }" ,
1486- " c" ,
1487- ),
1488- Cvoid,
1489- Tuple{Ptr{Float32}},
1490- data,
1491- )
1492- end
1493- nothing
1494- end
1495-
1496- @inline function markType (data:: Ptr{Float64} )
1497- @static if sizeof (Int) == sizeof (Int64)
1498- Base. llvmcall (
1499- (
1500- " declare void @__enzyme_double(i8* nocapture) nounwind define void @c(i64 %q) nounwind alwaysinline { %p = inttoptr i64 %q to i8* call void @__enzyme_double(i8* %p) ret void }" ,
1501- " c" ,
1502- ),
1503- Cvoid,
1504- Tuple{Ptr{Float64}},
1505- data,
1506- )
1507- else
1508- Base. llvmcall (
1509- (
1510- " declare void @__enzyme_double(i8* nocapture) nounwind define void @c(i32 %q) nounwind alwaysinline { %p = inttoptr i32 %q to i8* call void @__enzyme_double(i8* %p) ret void }" ,
1511- " c" ,
1512- ),
1513- Cvoid,
1514- Tuple{Ptr{Float64}},
1515- data,
1516- )
1517- end
1518- nothing
1519- end
1520-
15211449include (" sugar.jl" )
15221450
15231451function _import_frule end # defined in EnzymeChainRulesCoreExt extension
0 commit comments