[Openmcl-devel] llvm backend
gb at clozure.com
Mon Mar 28 22:14:50 UTC 2011
If I wasn't clear:
Suppose that we have some sort of specialized processor that can do
(for the sake of argument) matrix multiplication really quickly. I
can imagine that it's possible and useful to compile:
(defun multiply-matrices (a b result)
(declare (type (simple-array ...) a b result))
(%multiply-matrices a b result))
into a few native instructions for that processor and to download
that code and a few matrices into that procesor, cause the procesor
to execute that code with the right arguments, and obtain the result.
If we instead have:
(defun multiply-matrices (a b &optional (result (make-array ...)))
(%multiply-matrices a b result)
then I'm arguing that implementing MAKE-ARRAY natively may be much,
much harder than exploiting the machine's ability to do fast
arithmetic on vectors/matrices, and implementing MAKE-ARRAY on a GPU
may be disproportionately harder than implementing it on a more general
CPU generally is.
It's possible that things like OpenCL make this sort of thing easier
than doing it on the bare metal would be; it's also possible that those
things just get in the way. I think that it's fair to say that a GPU -
which may be extraordinarily good at certain things - may offer pretty
limited support (at the hardware level, at whatever level corresponds
to system software) for other things.
This is probably veering off into obscurity (it may have already
veered) and I'm not sure that I can express these concerns more
clearly. Those concerns don't really apply to things like Randall's
FPC code; the typical FPU and CPU are much more closely coupled than
a GPU and CPU are, and we don't have to puzzle over questions like
"how to implement MAKE-ARRAY using nothing but the FPU."
On Mon, 28 Mar 2011, Ron Garret wrote:
> On Mar 28, 2011, at 12:45 PM, Gary Byers wrote:
>> Porting a lisp to a GPU makes only slightly more sense to me than porting
>> a lisp to an FPU. (Yes there are differences and a GPU may be a lot closer
>> to it, buy neither is exactly a general-purpose computer. You can download
>> GPU code into the unit and execute it - so the FPU analogy breaks down -
>> but you'd probably find that that code can do some things incredibly quickly
>> and that other things are incredibly awkward.) You might be able to do
>> something that allows you to express certain kinds of algorithms in Lisp,
>> compile that code into machine code for a GPU, download that code, execute
>> it, and find that the GPU was fast enough to make that all worthwhile; that's
>> probably easier than it would be to figure out how to implement CONS reasonably
>> or how to implement OPEN at all.
> This is not quite as outlandish as Gary is making it sound. See:
> for inspiration.
More information about the Openmcl-devel