Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/workflows/perl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ jobs:
test:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- debian-10
- debian-11
- debian-12

os: [ubuntu-latest, debian-latest] # Updated to include latest Debian
perl: [system] # Use the Perl that comes pre-installed
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -30,13 +24,14 @@ jobs:
# ---- Install Perl Modules via CPAN ----
- name: Install Additional Perl Modules via CPAN
run: |
cpanm --verbose Alien::OpenMP Util::H2O::More File::Temp \
Test::Exception OpenMP::Environment File::ShareDir
sudo cpanm --verbose Alien::OpenMP Util::H2O::More File::Temp \
Test::Exception Test::Deep OpenMP::Environment File::ShareDir

# ---- Install Author Dependencies ----
- name: Install dzil authordeps
run: |
dzil authordeps --missing | cpanm --verbose # Install required author dependencies
dzil authordeps --missing | sudo cpanm --verbose # Install required author dependencies
sudo cpanm --verbose Dist::Zilla::Plugin::VersionFromModule

# ---- Run `dzil test` ----
- name: Run `dzil test`
Expand Down
6 changes: 5 additions & 1 deletion Change
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,9 @@
- int PerlOMP_1D_Array_NUM_ELEMENTS (SV *AVref)
- int PerlOMP_2D_AoA_NUM_ROWS(SV *AoAref)
- int PerlOMP_2D_AoA_NUM_COLS(SV *AoAref)
- void PerlOMP_1D_Array_TO_1D_STRING_ARRAY(SV *AVref, int numElements, char *retArray[numElements])
- void PerlOMP_1D_Array_TO_1D_STRING_ARRAY_r(SV *AVref, int numElements, char *retArray[numElements])
- added Github initial CI testing
- started documentation
- added Github initial CI testing for latest Ubuntu,
Rocky Linux
- added VERIFY C functions
1 change: 1 addition & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ OpenMP::Environment = 0
Util::H2O::More = >= 0.3.4
Test::More = 0
Test::Exception = 0
Test::Deep = 0
Digest::MD5 = 0
File::Temp = 0
[Prereqs]
Expand Down
141 changes: 135 additions & 6 deletions lib/OpenMP/Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ reference that's been populated via C<av_push>.

=back

=head PROVIDED PERL ARRAY COUNTING FUNCTIONS
=head1 PROVIDED PERL ARRAY COUNTING FUNCTIONS

=over 4

=item C<int PerlOMP_1D_Array_NUM_ELEMENTS (SV *AVref)>

Expand All @@ -204,6 +206,8 @@ Returns the number of elements in the first row of the provided 2D array
reference. It assumes all rows are the same. It doesn't verify the contents
of each row.

=back

=head1 PROVIDED PERL TO C CONVERSION FUNCTIONS

B<Note>: Work is currently focused on finding the true limits of the Perl C
Expand All @@ -213,13 +217,131 @@ structures into its pure C<C> equivalent.

=over 4

=item C<PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY(AoA, num_nodes, dims, nodes)>
=item C<PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY>

void PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY(SV *AVref, int numElements, float retArray[numElements]);

Converts a 1D Perl Array Reference (C<AV*>) into a 1D C array of floats. This function assumes the Perl array contains numeric floating point values.

=item C<PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY_r>

void PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY_r(SV *AVref, int numElements, float retArray[numElements]);

The parallelized version of C<PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY> using OpenMP. This function performs the same operation, but the array conversion is parallelized with OpenMP.

=item C<PerlOMP_1D_Array_TO_1D_INT_ARRAY>

void PerlOMP_1D_Array_TO_1D_INT_ARRAY(SV *AVref, int numElements, int retArray[numElements]);

Converts a 1D Perl Array Reference (C<AV*>) into a 1D C array of integers. This function assumes the Perl array contains integer values.

=item C<PerlOMP_1D_Array_TO_1D_INT_ARRAY_r>

void PerlOMP_1D_Array_TO_1D_INT_ARRAY_r(SV *AVref, int numElements, int retArray[numElements]);

The parallelized version of C<PerlOMP_1D_Array_TO_1D_INT_ARRAY> using OpenMP. This function performs the same operation, but the array conversion is parallelized with OpenMP.

=item C<PerlOMP_1D_Array_TO_1D_STRING_ARRAY>

void PerlOMP_1D_Array_TO_1D_STRING_ARRAY(SV *AVref, int numElements, char *retArray[numElements]);

Converts a 1D Perl Array Reference (C<AV*>) into a 1D C array of strings. The Perl array should contain string values.

=item C<PerlOMP_1D_Array_TO_1D_STRING_ARRAY_r>

void PerlOMP_1D_Array_TO_1D_STRING_ARRAY_r(SV *AVref, int numElements, char *retArray[numElements]);

The parallelized version of C<PerlOMP_1D_Array_TO_1D_STRING_ARRAY> using OpenMP. This function performs the same operation, but the array conversion is parallelized with OpenMP.

=item C<PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY>

void PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY(SV *AoA, int numRows, int rowSize, float retArray[numRows][rowSize]);

Converts a 2D Array of Arrays (AoA) in Perl into a 2D C array of floats. The Perl array should be an array of arrays, where each inner array contains floating point values.

=item C<PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY_r>

void PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY_r(SV *AoA, int numRows, int rowSize, float retArray[numRows][rowSize]);

The parallelized version of C<PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY> using OpenMP. This function performs the same operation, but the array conversion is parallelized with OpenMP.

=item C<PerlOMP_2D_AoA_TO_2D_INT_ARRAY>

void PerlOMP_2D_AoA_TO_2D_INT_ARRAY(SV *AoA, int numRows, int rowSize, int retArray[numRows][rowSize]);

Converts a 2D Array of Arrays (AoA) in Perl into a 2D C array of integers. The Perl array should be an array of arrays, where each inner array contains integer values.

=item C<PerlOMP_2D_AoA_TO_2D_INT_ARRAY_r>

void PerlOMP_2D_AoA_TO_2D_INT_ARRAY_r(SV *AoA, int numRows, int rowSize, int retArray[numRows][rowSize]);

The parallelized version of C<PerlOMP_2D_AoA_TO_2D_INT_ARRAY> using OpenMP. This function performs the same operation, but the array conversion is parallelized with OpenMP.

=item C<PerlOMP_2D_AoA_TO_2D_STRING_ARRAY>

void PerlOMP_2D_AoA_TO_2D_STRING_ARRAY(SV *AoA, int numRows, int rowSize, char *retArray[numRows][rowSize]);

Converts a 2D Array of Arrays (AoA) in Perl into a 2D C array of strings. The Perl array should be an array of arrays, where each inner array contains string values.

=item C<PerlOMP_2D_AoA_TO_2D_STRING_ARRAY_r>

void PerlOMP_2D_AoA_TO_2D_STRING_ARRAY_r(SV *AoA, int numRows, int rowSize, char *retArray[numRows][rowSize]);

The parallelized version of C<PerlOMP_2D_AoA_TO_2D_STRING_ARRAY> using OpenMP. This function performs the same operation, but the array conversion is parallelized with OpenMP.

=back

=head1 PROVIDED ARRAY MEMBER VERIFICATION FUNCTIONS

=over 4

=item C<PerlOMP_VERIFY_1D_Array>

void PerlOMP_VERIFY_1D_Array(SV* array);

Verifies that the given Perl variable is a valid 1D array reference.

=item C<PerlOMP_VERIFY_1D_INT_ARRAY>

void PerlOMP_VERIFY_1D_INT_ARRAY(SV* array);

Verifies that the given 1D array contains only integer values.

=item C<PerlOMP_VERIFY_1D_FLOAT_ARRAY>

Used to extract the contents of a 2D rectangular Perl array reference that
has been used to represent a 2D matrix.
void PerlOMP_VERIFY_1D_FLOAT_ARRAY(SV* array);

float nodes[num_nodes][dims];
PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY(AoA, num_nodes, dims, nodes);
Verifies that the given 1D array contains only floating-point values.

=item C<PerlOMP_VERIFY_1D_CHAR_ARRAY>

void PerlOMP_VERIFY_1D_CHAR_ARRAY(SV* array);

Verifies that the given 1D array contains only string values.

=item C<PerlOMP_VERIFY_2D_AoA>

void PerlOMP_VERIFY_2D_AoA(SV* array);

Verifies that the given Perl variable is a valid 2D array of arrays (AoA) reference.

=item C<PerlOMP_VERIFY_2D_INT_ARRAY>

void PerlOMP_VERIFY_2D_INT_ARRAY(SV* array);

Verifies that the given 2D array contains only integer values.

=item C<PerlOMP_VERIFY_2D_FLOAT_ARRAY>

void PerlOMP_VERIFY_2D_FLOAT_ARRAY(SV* array);

Verifies that the given 2D array contains only floating-point values.

=item C<PerlOMP_VERIFY_2D_STRING_ARRAY>

void PerlOMP_VERIFY_2D_STRING_ARRAY(SV* array);

Verifies that the given 2D array contains only string values.

=back

Expand All @@ -244,6 +366,13 @@ L<https://www.rperl.org>

Brett Estrade L<< <[email protected]> >>

=haed1 AI GENERATED CODE DISCLAIMER

Please be advised, for full transparency (and to set a good precedence),
one should not that the conversion functions, verification functions, their
POD entries, and testing functions werge generated with great assistance
using the "I<Perl Programming Expert By DRAKOPOULOS ANASTASIOS>" chatGPT.

=head1 LICENSE & COPYRIGHT

Same as Perl.
Loading
Loading