Skip to content

Commit f076974

Browse files
authored
Merge pull request #126 from yuyichao/pointer
Use pointer instead of unsafe_convert
2 parents 3a524cd + 81a0e60 commit f076974

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/utils/simd.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ end
135135
($textir, "entry"),
136136
Bool,
137137
Tuple{Ptr{T}, Ptr{T}, Int64},
138-
Base.unsafe_convert(Ptr{T}, a) + sizeof(T) * offset,
139-
Base.unsafe_convert(Ptr{T}, b) + sizeof(T) * offset,
138+
pointer(a) + sizeof(T) * offset,
139+
pointer(b) + sizeof(T) * offset,
140140
length(a) - offset
141141
)
142142
end
@@ -235,8 +235,8 @@ end
235235
($textir, "entry"),
236236
Bool,
237237
Tuple{Ptr{T}, Ptr{T}, Int64},
238-
Base.unsafe_convert(Ptr{T}, a) + sizeof(T) * offset,
239-
Base.unsafe_convert(Ptr{T}, b) + sizeof(T) * offset,
238+
pointer(a) + sizeof(T) * offset,
239+
pointer(b) + sizeof(T) * offset,
240240
length(a) - offset
241241
)
242242
end
@@ -349,8 +349,8 @@ end
349349
($textir, "entry"),
350350
Bool,
351351
Tuple{Ptr{T}, Ptr{T}, Int64},
352-
Base.unsafe_convert(Ptr{T}, a) + sizeof(T) * offset,
353-
Base.unsafe_convert(Ptr{T}, b) + sizeof(T) * offset,
352+
pointer(a) + sizeof(T) * offset,
353+
pointer(b) + sizeof(T) * offset,
354354
length(a) - offset
355355
)
356356
end
@@ -467,8 +467,8 @@ end
467467
($textir, "entry"),
468468
Bool,
469469
Tuple{Ptr{T}, Ptr{T}, Int64},
470-
Base.unsafe_convert(Ptr{T}, a) + sizeof(T) * offset,
471-
Base.unsafe_convert(Ptr{T}, b) + sizeof(T) * offset,
470+
pointer(a) + sizeof(T) * offset,
471+
pointer(b) + sizeof(T) * offset,
472472
length(a) - offset
473473
)
474474
end

0 commit comments

Comments
 (0)