Pelles C forum

C language => Expert questions => Topic started by: danz68 on October 08, 2019, 02:57:33 pm

Title: linking ispc binaries.
Post by: danz68 on October 08, 2019, 02:57:33 pm
Hi there,

Is it any possibility to link object files generated by ISPC
(https://ispc.github.io/ispc.html) with PellesC suite?

Same question for linking Microsoft libraries.

Thank you.

Title: Re: linking ispc binaries.
Post by: TimoVJL on October 08, 2019, 03:32:00 pm
While waiting experts.

ispc generate normal object files, like PE-COFF.
tested simple example.
Code: [Select]
#include <stdio.h>
#include <stdlib.h>
// Include the header file that the ispc compiler generates
#include "simple_ispc.h"
//using namespace ispc;
#pragma comment(linker, "simple_ispc.o")

int main(void) {
    float vin[16], vout[16];

    // Initialize input buffer
    for (int i = 0; i < 16; ++i)
        vin[i] = (float)i;

    // Call simple() function from simple.ispc file
    simple(vin, vout, 16);

    // Print results
    for (int i = 0; i < 16; ++i)
        printf("%d: simple(%f) = %f\n", i, vin[i], vout[i]);

    return 0;
}
Title: Re: linking ispc binaries.
Post by: danz68 on October 09, 2019, 12:50:55 pm
These are great news.

I tried a similar test (custom code though), making a DLL and error was there.
(don't remember now error or code, I tried a couple of times then I gave up. It must be something else wrong).

Any new version since 9.00 Aug 2018?
Title: Re: linking ispc binaries.
Post by: Pelle on October 13, 2019, 10:26:24 pm
While waiting experts.
I'm waiting too...