Skip to content
Merged
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
18 changes: 9 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Core Library
:maxdepth: 1

modules/src/CVL
modules/src/Vector
modules/src/VectorRef
modules/src/CVL/Vector
modules/src/CVL/VectorRef

Intrinsics
**********
Expand All @@ -19,7 +19,7 @@ CVL implements all of the higher level vector operations using a lower level lib
.. toctree::
:maxdepth: 1

modules/src/Intrin
modules/src/CVL/Intrin

Internal Intrinsics
~~~~~~~~~~~~~~~~~~~
Expand All @@ -29,10 +29,10 @@ These modules are the internal implementation types used by the intrinsics. They
.. toctree::
:maxdepth: 1

modules/src/IntrinX86_128
modules/src/IntrinX86_256
modules/src/IntrinArm64_128
modules/src/IntrinArm64_256
modules/src/CVL/IntrinX86_128
modules/src/CVL/IntrinX86_256
modules/src/CVL/IntrinArm64_128
modules/src/CVL/IntrinArm64_256

SLEEF
~~~~~
Expand All @@ -43,7 +43,7 @@ See https://sleef.org/ for more information.
.. toctree::
:maxdepth: 1

modules/src/SLEEF
modules/src/CVL/SLEEF


Utilities
Expand All @@ -52,7 +52,7 @@ Utilities
.. toctree::
:maxdepth: 1

modules/src/Arch
modules/src/CVL/Arch


Indices and tables
Expand Down
6 changes: 3 additions & 3 deletions lint/OperatorsUpToDate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
PROJECT_DIR=$(cd $(dirname $0); cd ..; pwd)
set -e

# rebuild operators from Vectors.chpl, make sure it matches src/Vector/Operators.chpl
# rebuild operators from Vectors.chpl, make sure it matches src/CVL/Vector/Operators.chpl
TEMP=$(mktemp -d)
(set -x && $PROJECT_DIR/util/generate_ops.py --filename $PROJECT_DIR/src/Vector.chpl --output $TEMP/Operators.chpl)
(set -x && diff -u $PROJECT_DIR/src/Vector/Operators.chpl $TEMP/Operators.chpl)
(set -x && $PROJECT_DIR/util/generate_ops.py --filename $PROJECT_DIR/src/CVL/Vector.chpl --output $TEMP/Operators.chpl)
(set -x && diff -u $PROJECT_DIR/src/CVL/Vector/Operators.chpl $TEMP/Operators.chpl)
(set -x && rm -rf $TEMP)
13 changes: 13 additions & 0 deletions src/CVL.chpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
module CVL {
config param implementationWarnings = true;
// public
include module Vector;
include module VectorRef;

// helpers
include module Arch;
include module Intrin;
include module IntrinArm64_128;
include module IntrinArm64_256;
include module IntrinX86_128;
include module IntrinX86_256;
include module SLEEF;

public use Vector;
public use VectorRef;
}
File renamed without changes.
10 changes: 5 additions & 5 deletions src/Intrin.chpl → src/CVL/Intrin.chpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module Intrin {
use CTypes only c_ptr, c_ptrConst, c_int;
use Arch only isX8664, isArm64;
use super.Arch only isX8664, isArm64;

proc vectorType(type eltType, param numElts: int) type do
return implType(eltType, numElts).vecType;
proc implType(type eltType, param numElts: int) type {
if isX8664() && numBits(eltType) * numElts == 128 {
use IntrinX86_128;
use super.IntrinX86_128;
if eltType == real(32) then return x8664_32x4r;
else if eltType == real(64) then return x8664_64x2r;
else if eltType == int(8) then return x8664_8x16i;
Expand All @@ -16,7 +16,7 @@ module Intrin {
else compilerError("Unsupported vector type");

} else if isX8664() && numBits(eltType) * numElts == 256 {
use IntrinX86_256;
use super.IntrinX86_256;
if eltType == real(32) then return x8664_32x8r;
else if eltType == real(64) then return x8664_64x4r;
else if eltType == int(8) then return x8664_8x32i;
Expand All @@ -26,7 +26,7 @@ module Intrin {
else compilerError("Unsupported vector type");

} else if isArm64() && numBits(eltType) * numElts == 128 {
use IntrinArm64_128;
use super.IntrinArm64_128;
if eltType == real(32) then return arm64_32x4r;
else if eltType == real(64) then return arm64_64x2r;
else if eltType == int(8) then return arm64_8x16i;
Expand All @@ -36,7 +36,7 @@ module Intrin {
else compilerError("Unsupported vector type");

} else if isArm64() && numBits(eltType) * numElts == 256 {
use IntrinArm64_256;
use super.IntrinArm64_256;
if eltType == real(32) then return arm64_32x8r;
else if eltType == real(64) then return arm64_64x4r;
else if eltType == int(8) then return arm64_8x32i;
Expand Down
2 changes: 1 addition & 1 deletion src/IntrinArm64_128.chpl → src/CVL/IntrinArm64_128.chpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@chplcheck.ignore("PascalCaseModules")
module IntrinArm64_128 {
use CTypes only c_ptr, c_ptrConst, c_int;
use Arch only isArm64;
use super.Arch only isArm64;
use Reflection only canResolveTypeMethod, getRoutineName;
if isArm64() {
require "arm_neon.h";
Expand Down
2 changes: 1 addition & 1 deletion src/IntrinArm64_256.chpl → src/CVL/IntrinArm64_256.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* There is no 256 for neon, this emulates it */
@chplcheck.ignore("PascalCaseModules")
module IntrinArm64_256 {
use IntrinArm64_128 only numBits, vecTypeStr;
use super.IntrinArm64_128 only numBits, vecTypeStr;
use CTypes only c_ptr, c_ptrConst, c_int;
use Reflection only getRoutineName;

Expand Down
2 changes: 1 addition & 1 deletion src/IntrinX86_128.chpl → src/CVL/IntrinX86_128.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module IntrinX86_128 {
use CTypes only c_ptr, c_ptrConst, c_int;
use Reflection only canResolveTypeMethod, getRoutineName;
use Arch only isX8664;
use super.Arch only isX8664;
if isX8664() {
require "x86intrin.h";
require "IntrinX86_128/wrapper-x86-128.h";
Expand Down
4 changes: 2 additions & 2 deletions src/IntrinX86_256.chpl → src/CVL/IntrinX86_256.chpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@chplcheck.ignore("PascalCaseModules")
module IntrinX86_256 {
use IntrinX86_128 only doSimpleOp, numBits, x8664_NxM,
use super.IntrinX86_128 only doSimpleOp, numBits, x8664_NxM,
vec32x4r, vec64x2r,
vec8x16i, vec16x8i, vec32x4i, vec64x2i,
vec8x16u, vec16x8u, vec32x4u, vec64x2u,
Expand All @@ -10,7 +10,7 @@ module IntrinX86_256 {

use CTypes only c_ptr, c_ptrConst;
use Reflection only canResolveTypeMethod;
use Arch only isX8664;
use super.Arch only isX8664;
if isX8664() {
require "x86intrin.h";
require "IntrinX86_256/wrapper-x86-256.h";
Expand Down
8 changes: 4 additions & 4 deletions src/SLEEF.chpl → src/CVL/SLEEF.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module SLEEF {
require SLEEF_INSTALL + "/lib/libsleef.a";
}

use Intrin only implType, vectorType;
use Arch only isX8664, isArm64;
use super.Intrin only implType, vectorType;
use super.Arch only isX8664, isArm64;


inline proc doSimpleOp(
Expand All @@ -21,15 +21,15 @@ module SLEEF {
proc getNumLanes() param : int {
param numLanes = impl.vecType.numBits / numBits(impl.laneType);
if isArm64() {
import IntrinArm64_256.vecPair;
import super.IntrinArm64_256.vecPair;
if isSubtype(impl.vecType, vecPair) then return numLanes / 2;
}
return numLanes;
}
param funcName = "Sleef_" + name + suffix + getNumLanes():string + "_u10";

if isArm64() {
import IntrinArm64_256.vecPair;
import super.IntrinArm64_256.vecPair;
if isSubtype(impl.vecType, vecPair) {
pragma "fn synchronization free"
extern funcName proc func(x: impl.vecType.vt): impl.vecType.vt;
Expand Down
16 changes: 8 additions & 8 deletions src/Vector.chpl → src/CVL/Vector.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Vector {
use CTypes only c_ptr, c_ptrConst,
c_ptrTo, c_ptrToConst,
c_addrOf, c_addrOfConst, c_int;
import Intrin;
use VectorRef only vectorRef;
import super.Intrin;
use super.VectorRef only vectorRef;

proc numBits(type t) param: int where isSubtype(t, vector) do
return numBits(t.eltType) * t.numElts;
Expand Down Expand Up @@ -872,7 +872,7 @@ module Vector {
compilerError(
"sin is only defined for real types, not " + eltType:string);

import SLEEF.sleef;
import super.SLEEF.sleef;
var result: x.type;
result.data = sleef.sin(eltType, numElts, x.data);
return result;
Expand All @@ -883,7 +883,7 @@ module Vector {
compilerError(
"cos is only defined for real types, not " + eltType:string);

import SLEEF.sleef;
import super.SLEEF.sleef;
var result: x.type;
result.data = sleef.cos(eltType, numElts, x.data);
return result;
Expand All @@ -894,7 +894,7 @@ module Vector {
compilerError(
"tan is only defined for real types, not " + eltType:string);

import SLEEF.sleef;
import super.SLEEF.sleef;
var result: x.type;
result.data = sleef.tan(eltType, numElts, x.data);
return result;
Expand All @@ -905,7 +905,7 @@ module Vector {
compilerError(
"asin is only defined for real types, not " + eltType:string);

import SLEEF.sleef;
import super.SLEEF.sleef;
var result: x.type;
result.data = sleef.asin(eltType, numElts, x.data);
return result;
Expand All @@ -916,7 +916,7 @@ module Vector {
compilerError(
"acos is only defined for real types, not " + eltType:string);

import SLEEF.sleef;
import super.SLEEF.sleef;
var result: x.type;
result.data = sleef.acos(eltType, numElts, x.data);
return result;
Expand All @@ -927,7 +927,7 @@ module Vector {
compilerError(
"atan is only defined for real types, not " + eltType:string);

import SLEEF.sleef;
import super.SLEEF.sleef;
var result: x.type;
result.data = sleef.atan(eltType, numElts, x.data);
return result;
Expand Down
4 changes: 2 additions & 2 deletions src/Vector/Operators.chpl → src/CVL/Vector/Operators.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Autogenerated by generate_ops.py: DO NOT EDIT
//
module Operators {
use Vector only vector;
import Intrin;
use super.super.Vector only vector;
import super.Intrin;

/*
Implements ``VECTOR + VECTOR``
Expand Down
2 changes: 1 addition & 1 deletion src/VectorRef.chpl → src/CVL/VectorRef.chpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module VectorRef {

use Vector only vector;
use super.Vector only vector;
use CTypes only c_ptr, c_ptrConst, c_ptrTo, c_ptrToConst;

/* a transparent record that iterators can yield,
Expand Down
2 changes: 1 addition & 1 deletion test/TestHelpers.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ proc toHex(tup, param filled = false) where isTuple(tup) {
}
return res;
}
import Vector.vector;
import CVL.vector;
proc toHex(x: vector(?), param filled = false) {
return toHex(x.toTuple(), filled=filled);
}
Expand Down
4 changes: 2 additions & 2 deletions util/generate_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ def parse(self) -> List[Expression]:
// Autogenerated by generate_ops.py: DO NOT EDIT
//
module @@{mod_name} {
use Vector only vector;
import Intrin;
use super.super.Vector only vector;
import super.Intrin;

@@{contents}
}
Expand Down
Loading