Initial commit.

This commit is contained in:
2017-10-26 19:57:24 +02:00
commit 9ce8b5485d
1090 changed files with 47036 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
########################################################################
# Target
########################################################################
DIRS = src/spu src/ppu
########################################################################
# buildutils/make.footer
########################################################################
ifdef CELL_TOP
include $(CELL_TOP)/buildutils/make.footer
else
include /opt/cell/sdk/buildutils/make.footer
endif
+25
View File
@@ -0,0 +1,25 @@
########################################################################
# Target
########################################################################
PROGRAM_ppu64 = ../../simple_init
########################################################################
# Local Defines
########################################################################
INCLUDE = -I../../../../include/ppu
LDFLAGS = -L../../../../lib/ppu
IMPORTS = -lmoc_ppu -lspe2 ../spu/simple_init_spu.a
########################################################################
# buildutils/make.footer
########################################################################
ifdef CELL_TOP
include $(CELL_TOP)/buildutils/make.footer
else
include /opt/cell/sdk/buildutils/make.footer
endif
+64
View File
@@ -0,0 +1,64 @@
#include <moc.h>
#include <stdlib.h>
#include <string.h>
#include <malloc_align.h>
extern spe_program_handle_t simple_init_spu;
int main()
{
int t, rank, size, rl, mspu, aspu;
char proc[4];
if (MOC_Get_max_spu_count(&mspu))
{
printf("An error occured during MOC_Get_max_spu_count\n");
return 0;
}
if (MOC_Get_avail_spu_count(&aspu))
{
printf("An error occured during MOC_Get_avail_spu_count\n");
return 0;
}
printf("\nThere are %i of %i SPUs available.\n\n", aspu, mspu);
for (t = 1; t <= aspu; t++)
{
uint32_t res = MOC_Add_spu_thread ( &simple_init_spu, NULL );
switch (res)
{
case MOC_SUCCESS:
printf("Add SPU-thread %i: Success\n", t);
break;
case MOC_ERR_BUFFER_OVERFLOW:
printf("Add SPU-thread %i: Exceeded MOC_SPU_THREAD_MAX\n", t);
break;
case MOC_ERR_INTERN:
printf("Add SPU-thread %i: Internal error\n", t);
break;
default:
printf("Add SPU-thread %i: Unknown error\n", t);
break;
}
}
printf("\n");
MOC_Init(NULL, NULL);
MOC_Comm_rank(MOC_COMM_WORLD, &rank);
MOC_Comm_size(MOC_COMM_WORLD, &size);
MOC_Get_processor_name( proc, &rl);
printf("Process %i from %i running on %s: Hello World!\n ", rank, size, proc);
MOC_Finalize();
return 0;
}
+25
View File
@@ -0,0 +1,25 @@
########################################################################
# Target
########################################################################
PROGRAMS_spu := simple_init_spu
LIBRARY_embed64 := simple_init_spu.a
########################################################################
# Local Defines
########################################################################
INCLUDE = -I../../../../include/spu
LDFLAGS = -L../../../../lib/spu
IMPORTS = -lmoc_spu
########################################################################
# buildutils/make.footer
########################################################################
ifdef CELL_TOP
include $(CELL_TOP)/buildutils/make.footer
else
include /opt/cell/sdk/buildutils/make.footer
endif
+23
View File
@@ -0,0 +1,23 @@
#include <moc.h>
#include <stdio.h>
int main()
{
int rank, size, rl;
char proc[4];
MOC_Init( 0, 0, NULL);
MOC_Comm_rank(MOC_COMM_WORLD, &rank);
MOC_Comm_size(MOC_COMM_WORLD, &size);
MOC_Get_processor_name( proc, &rl);
printf("Process %i from %i running on %s: Hello World!\n ", rank, size, proc);
MOC_Finalize();
return 0;
}