Skip to content

Commit

Permalink
get the new-ccall branch back in working order
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 6, 2012
1 parent d1851c3 commit 90e616a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions jl/linalg_blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ for (fname, elty) in ((:dgemm_,:Float64), (:sgemm_,:Float32),
alpha::($elty), A::StridedMatrix{$elty}, lda::Integer,
B::StridedMatrix{$elty}, ldb::Integer,
beta::($elty), C::StridedMatrix{$elty}, ldc::Integer)
ccall(dlsym(_jl_libblas, $fname),
ccall(dlsym(_jl_libblas, $string(fname)),
Void,
(Ptr{Uint8}, Ptr{Uint8}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32},
Ptr{$elty}, Ptr{$elty}, Ptr{Int32},
Expand Down Expand Up @@ -216,7 +216,7 @@ for (fname, elty) in ((:dgemv_,:Float64), (:sgemv_,:Float32),
alpha::($elty), A::StridedMatrix{$elty}, lda::Integer,
X::StridedVector{$elty}, incx::Integer,
beta::($elty), Y::StridedVector{$elty}, incy::Integer)
ccall(dlsym(_jl_libblas, $fname),
ccall(dlsym(_jl_libblas, $string(fname)),
Void,
(Ptr{Uint8}, Ptr{Int32}, Ptr{Int32},
Ptr{$elty}, Ptr{$elty}, Ptr{Int32},
Expand Down
10 changes: 5 additions & 5 deletions jl/math_libm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ let
ccall(dlsym(_jl_libamos, :zbesh_), Void,
(Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32},
Ptr{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32}),
real(z), imag(z), nu, int32(1), int32(k), int32(1),
&real(z), &imag(z), &nu, &int32(1), &int32(k), &int32(1),
pointer(cy,1), pointer(cy,2),
pointer(ae,1), pointer(ae,2))
return complex(cy[1],cy[2])
Expand All @@ -228,7 +228,7 @@ let
ccall(dlsym(_jl_libamos, :zbesi_), Void,
(Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32},
Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32}),
real(z), imag(z), nu, int32(1), int32(1),
&real(z), &imag(z), &nu, &int32(1), &int32(1),
pointer(cy,1), pointer(cy,2),
pointer(ae,1), pointer(ae,2))
return complex(cy[1],cy[2])
Expand All @@ -238,7 +238,7 @@ let
ccall(dlsym(_jl_libamos, :zbesj_), Void,
(Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32},
Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32}),
real(z), imag(z), nu, int32(1), int32(1),
&real(z), &imag(z), &nu, &int32(1), &int32(1),
pointer(cy,1), pointer(cy,2),
pointer(ae,1), pointer(ae,2))
return complex(cy[1],cy[2])
Expand All @@ -248,7 +248,7 @@ let
ccall(dlsym(_jl_libamos, :zbesk_), Void,
(Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32},
Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32}),
real(z), imag(z), nu, int32(1), int32(1),
&real(z), &imag(z), &nu, &int32(1), &int32(1),
pointer(cy,1), pointer(cy,2),
pointer(ae,1), pointer(ae,2))
return complex(cy[1],cy[2])
Expand All @@ -259,7 +259,7 @@ let
(Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32},
Ptr{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Int32},
Ptr{Float64}, Ptr{Float64}, Ptr{Int32}),
real(z), imag(z), nu, int32(1), int32(1),
&real(z), &imag(z), &nu, &int32(1), &int32(1),
pointer(cy,1), pointer(cy,2),
pointer(ae,1), pointer(wrk,1),
pointer(wrk,2), pointer(ae,2))
Expand Down
4 changes: 1 addition & 3 deletions jl/pointer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ convert{T}(::Type{Ptr{T}}, p::Ptr) = box(Ptr{T}, p)

# object to pointer
convert(::Type{Ptr{Uint8}}, x::Symbol) = ccall(:jl_symbol_name, Ptr{Uint8}, (Any,), x)
convert(::Type{Ptr{Void}}, a::Array) = ccall(:jl_array_ptr, Ptr{Void}, (Any,), a)
convert(::Type{Ptr{Void}}, a::Array{None}) = ccall(:jl_array_ptr, Ptr{Void}, (Any,), a)
convert{T}(::Type{Ptr{T}}, a::Array{T}) = convert(Ptr{T}, convert(Ptr{Void}, a))
convert{T}(::Type{Ptr{T}}, a::Array) = ccall(:jl_array_ptr, Ptr{T}, (Any,), a)
convert(::Type{Ptr{Uint8}}, s::ByteString) = convert(Ptr{Uint8}, s.data)

pointer{T}(::Type{T}, x::Uint) = convert(Ptr{T}, x)
Expand Down
2 changes: 2 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ static Function *to_function(jl_lambda_info_t *li)
FPM->run(*f);
//n_compile++;
// print out the function's LLVM code
//ios_printf(ios_stderr, "%s:%d\n",
// ((jl_sym_t*)li->file)->name, jl_unbox_long(li->line));
//f->dump();
//verifyFunction(*f);
if (old != NULL) {
Expand Down

0 comments on commit 90e616a

Please sign in to comment.