Displaying 6 results from an estimated 6 matches for "magic_command".
2002 Aug 05
2
filename of source file
Hi
Is there a command which will return the complete pathname of the
file from which the current source is being read? I want something which
can be inserted into any .r file and it will be able to ascertain
exactly where it is, so that it can save data to the same directory, no
matter where it is, regardless of what the current working directory is.
Dave Richmond
daver969 at mac.com
2019 Jul 08
2
Using bytecode version of std::sort for JIT generated data type
Thanks David!
I am not clear on how to achieve this though. Could you give more info on
this?
I expect something like this:
sort.cc file:
bool Compare(void* a, void* b) {
return false;
}
void SortFunc(void* arr, int len) {
std::sort(arr, len, &Compare)
}
$MAGIC_COMMAND sort.cc -o a.llvm
a.llvm is a bytecode which can be loaded at runtime in my JIT module and
write some code to replace "Compare" function with our own "Compare"
function.
On Mon, Jul 8, 2019 at 1:17 PM David Blaikie <dblaikie at gmail.com> wrote:
> That's an opt...
2019 Jul 09
2
Using bytecode version of std::sort for JIT generated data type
...s?
>>
>> I expect something like this:
>>
>> sort.cc file:
>>
>> bool Compare(void* a, void* b) {
>> return false;
>> }
>>
>> void SortFunc(void* arr, int len) {
>> std::sort(arr, len, &Compare)
>> }
>>
>> $MAGIC_COMMAND sort.cc -o a.llvm
>>
>> a.llvm is a bytecode which can be loaded at runtime in my JIT module and
>> write some code to replace "Compare" function with our own "Compare"
>> function.
>>
>>
>>
>> On Mon, Jul 8, 2019 at 1:17 PM David...
2019 Jul 10
2
Using bytecode version of std::sort for JIT generated data type
...e:
>>>>
>>>> bool Compare(void* a, void* b) {
>>>> return false;
>>>> }
>>>>
>>>> void SortFunc(void* arr, int len) {
>>>> std::sort(arr, len, &Compare)
>>>> }
>>>>
>>>> $MAGIC_COMMAND sort.cc -o a.llvm
>>>>
>>>> a.llvm is a bytecode which can be loaded at runtime in my JIT module
>>>> and write some code to replace "Compare" function with our own "Compare"
>>>> function.
>>>>
>>>>
>>...
2002 Aug 05
1
pipe and binary i/o
...; David Richmond wrote:
> > Yes, source refers to the use of the source() function. Suppose I invoke
> > a file like so:
> >
> > source("/path/name/filename.r")
> >
> > I want to insert a command in filename.r like so:
> >
> > fullpath <- magic_command()
> >
> > such that fullpath is now "/path/name/filename.r"
> >
>
> How about
>
> source(fullpath<-"/path/name/filename.r") ?
>
That will work only when run at the top level.
If it isn't sufficient to know the directory
source("/...
2019 Jul 03
2
Using bytecode version of std::sort for JIT generated data type
Thanks David! I understand that std::sort doesn't exist without types
especially at bytecode layer.
What I was thinking was something like the following:
Compile std::sort with a thunk function Compare(void*, void*) {rerturn
false} into bytecode with an option say noinline and always make the
function call or even a simple unoptimized bytecode which guarantees that
Compare exists as a