diff options
-rw-r--r-- | Makefile.inc | 4 | ||||
-rw-r--r-- | docs/sphinx-doc/source/change_log.rst | 3 | ||||
-rw-r--r-- | docs/sphinx-doc/source/examples.rst | 4 | ||||
-rw-r--r-- | docs/sphinx-doc/source/supported_constructs.rst | 11 | ||||
-rw-r--r-- | examples/edmabw/Makefile | 59 | ||||
-rw-r--r-- | examples/edmabw/bandwidth.c | 62 | ||||
-rw-r--r-- | examples/edmabw/edmabw_host.cpp | 129 | ||||
-rw-r--r-- | examples/edmabw/edmabw_main.cpp | 114 | ||||
-rw-r--r-- | examples/edmabw/edmabw_target.c | 98 | ||||
-rw-r--r-- | examples/edmabw/edmamgr.h | 130 | ||||
-rw-r--r-- | host/include/omp.h | 2 | ||||
-rw-r--r-- | host/include/ti_omp_device.h | 16 | ||||
-rw-r--r-- | host/version.txt | 2 |
13 files changed, 22 insertions, 612 deletions
diff --git a/Makefile.inc b/Makefile.inc index 7fc748d..094725d 100644 --- a/Makefile.inc +++ b/Makefile.inc | |||
@@ -34,7 +34,7 @@ | |||
34 | UNAME_M:=$(shell uname -m) | 34 | UNAME_M:=$(shell uname -m) |
35 | 35 | ||
36 | SDOMC_SHARED ?= /cgnas | 36 | SDOMC_SHARED ?= /cgnas |
37 | CORESDK_VERSION ?= 05.02.00.10-release | 37 | CORESDK_VERSION ?= 06.00.00.07-release |
38 | 38 | ||
39 | # SOC PSDK | 39 | # SOC PSDK |
40 | ifeq ($(BUILD_K2H),1) | 40 | ifeq ($(BUILD_K2H),1) |
@@ -66,7 +66,7 @@ else | |||
66 | endif | 66 | endif |
67 | 67 | ||
68 | ifeq (,$(findstring arm, $(UNAME_M))) | 68 | ifeq (,$(findstring arm, $(UNAME_M))) |
69 | LINUX_DEVKIT_ROOT?=$(CORE_SDK)/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi | 69 | LINUX_DEVKIT_ROOT?=$(CORE_SDK)/linux-devkit/sysroots/armv7at2hf-neon-linux-gnueabi |
70 | else | 70 | else |
71 | LINUX_DEVKIT_ROOT?=/ | 71 | LINUX_DEVKIT_ROOT?=/ |
72 | endif | 72 | endif |
diff --git a/docs/sphinx-doc/source/change_log.rst b/docs/sphinx-doc/source/change_log.rst index 596adc2..ed6684a 100644 --- a/docs/sphinx-doc/source/change_log.rst +++ b/docs/sphinx-doc/source/change_log.rst | |||
@@ -1,6 +1,9 @@ | |||
1 | Change Log | 1 | Change Log |
2 | ********** | 2 | ********** |
3 | 3 | ||
4 | 1.5.6.0, Processor SDK 6.2 | ||
5 | * Documentation clarification on unsupported variadic functions. | ||
6 | |||
4 | 1.3.0, Released 04-12-2016 | 7 | 1.3.0, Released 04-12-2016 |
5 | * Fixed memory leak with mapping variables | 8 | * Fixed memory leak with mapping variables |
6 | * Added support for AM572, 66AK2L, 66AK2E and 66AK2G platfroms | 9 | * Added support for AM572, 66AK2L, 66AK2E and 66AK2G platfroms |
diff --git a/docs/sphinx-doc/source/examples.rst b/docs/sphinx-doc/source/examples.rst index 892f837..6dc1334 100644 --- a/docs/sphinx-doc/source/examples.rst +++ b/docs/sphinx-doc/source/examples.rst | |||
@@ -60,7 +60,3 @@ The OpenMPAcc examples are installed in the directory ``/usr/share/ti/examples/o | |||
60 | **dotprod_fileread** | 60 | **dotprod_fileread** |
61 | 61 | ||
62 | Demonstrates how target regions may be used within a parallel region. Four OpenMP threads on the ARM concurrently read the input arrays. Then each thread offloads the computation of the dot product of its input to the DSPs, one at a time, within a critical region. | 62 | Demonstrates how target regions may be used within a parallel region. Four OpenMP threads on the ARM concurrently read the input arrays. Then each thread offloads the computation of the dot product of its input to the DSPs, one at a time, within a critical region. |
63 | |||
64 | **edmabw** | ||
65 | |||
66 | Measures the average access times between different memory regions (DDR, MSMC, L2 SRAM) for a DSP core using EDMA manager. | ||
diff --git a/docs/sphinx-doc/source/supported_constructs.rst b/docs/sphinx-doc/source/supported_constructs.rst index e0e0322..e8f6d13 100644 --- a/docs/sphinx-doc/source/supported_constructs.rst +++ b/docs/sphinx-doc/source/supported_constructs.rst | |||
@@ -55,7 +55,7 @@ host (ARM Linux) memory. Upon encountering a target construct: | |||
55 | - Space is allocated in device memory for variables a[0:size], b[0:size], c[0:size] and size. | 55 | - Space is allocated in device memory for variables a[0:size], b[0:size], c[0:size] and size. |
56 | - Any variables annotated ‘to’ are **copied** from host memory |rarr| device memory. | 56 | - Any variables annotated ‘to’ are **copied** from host memory |rarr| device memory. |
57 | - The target region is executed on the device. Note that **#pragma omp parallel for** is used to distribute iterations of the for loop across the 8 DSP cores. | 57 | - The target region is executed on the device. Note that **#pragma omp parallel for** is used to distribute iterations of the for loop across the 8 DSP cores. |
58 | - Any variables annotated ‘from’ are **copied** from device memory |rarr| host memory. | 58 | - Any variables annotated ‘from’ are **copied** from device memory |rarr| host memory. |
59 | 59 | ||
60 | The figure below illustrates mapping of variables from host to device memory. | 60 | The figure below illustrates mapping of variables from host to device memory. |
61 | 61 | ||
@@ -63,10 +63,13 @@ The figure below illustrates mapping of variables from host to device memory. | |||
63 | :scale: 50% | 63 | :scale: 50% |
64 | :align: center | 64 | :align: center |
65 | 65 | ||
66 | |||
67 | To reduce the overhead of copying variables between host and target | 66 | To reduce the overhead of copying variables between host and target |
68 | devices, refer section :ref:`ompa_reduce_offload_overhead`. | 67 | devices, refer section :ref:`ompa_reduce_offload_overhead`. |
69 | 68 | ||
69 | Please note that variadic function declaration and definition is not supported | ||
70 | within the target region. Support for variadic functions is not planned for | ||
71 | future releases at this time. | ||
72 | |||
70 | #pragma omp declare target | 73 | #pragma omp declare target |
71 | -------------------------- | 74 | -------------------------- |
72 | 75 | ||
@@ -99,7 +102,7 @@ region. | |||
99 | } | 102 | } |
100 | } | 103 | } |
101 | 104 | ||
102 | | | 105 | | |
103 | 106 | ||
104 | #pragma omp target data | 107 | #pragma omp target data |
105 | ----------------------- | 108 | ----------------------- |
@@ -126,7 +129,7 @@ Target data regions may also be nested. | |||
126 | } | 129 | } |
127 | } /* Device -> Host data transfer of buffer c is done here*/ | 130 | } /* Device -> Host data transfer of buffer c is done here*/ |
128 | 131 | ||
129 | | | 132 | | |
130 | 133 | ||
131 | #pragma omp target update | 134 | #pragma omp target update |
132 | ------------------------- | 135 | ------------------------- |
diff --git a/examples/edmabw/Makefile b/examples/edmabw/Makefile deleted file mode 100644 index f24ebde..0000000 --- a/examples/edmabw/Makefile +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | #***************************************************************************** | ||
2 | # Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | # All rights reserved. | ||
4 | # | ||
5 | # Redistribution and use in source and binary forms, with or without | ||
6 | # modification, are permitted provided that the following conditions are met: | ||
7 | # * Redistributions of source code must retain the above copyright | ||
8 | # notice, this list of conditions and the following disclaimer. | ||
9 | # * Redistributions in binary form must reproduce the above copyright | ||
10 | # notice, this list of conditions and the following disclaimer in the | ||
11 | # documentation and/or other materials provided with the distribution. | ||
12 | # * Neither the name of Texas Instruments Incorporated nor the | ||
13 | # names of its contributors may be used to endorse or promote products | ||
14 | # derived from this software without specific prior written permission. | ||
15 | # | ||
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
26 | # THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | #**************************************************************************** | ||
28 | EXE = edmabw | ||
29 | include ../make.inc | ||
30 | |||
31 | OA_TC_OPTS = -O3 | ||
32 | ifeq ($(VERBOSE),1) | ||
33 | OA_HC_OPTS = -O3 -Wall -Wextra -fopenmp | ||
34 | OA_SHELL_OPTS = -v -k --hc="$(OA_HC_OPTS)" --tc="$(OA_TC_OPTS)" | ||
35 | else | ||
36 | OA_HC_OPTS = -O3 -fopenmp | ||
37 | OA_SHELL_OPTS = --hc="$(OA_HC_OPTS)" --tc="$(OA_TC_OPTS)" | ||
38 | endif | ||
39 | CXX_OPTS = -O3 -I$(TARGET_ROOTDIR)/usr/include | ||
40 | |||
41 | HOST_CODE = edmabw_main.cpp edmabw_host.cpp | ||
42 | TARGET_CODE = edmabw_target.c | ||
43 | OBJS = $(patsubst %.cpp,%.o,$(HOST_CODE)) | ||
44 | |||
45 | TARGET_SOURCE = bandwidth.c | ||
46 | TARGET_OBJS = $(patsubst %.c,%.obj,$(TARGET_SOURCE)) | ||
47 | CL6X_OPTS = -mv6600 --abi=eabi -o3 $(TARGET_INCLUDE) | ||
48 | |||
49 | $(EXE): $(OBJS) $(TARGET_OBJS) | ||
50 | $(OA_SHELL) $(OA_SHELL_OPTS) $(OBJS) $(TARGET_OBJS) $(TARGET_CODE) -o $@ | ||
51 | |||
52 | %.o: %.cpp | ||
53 | $(CXX) $(CXX_OPTS) -c $< | ||
54 | |||
55 | %.obj : %.c | ||
56 | $(CL6X) $(CL6X_OPTS) -c $< | ||
57 | |||
58 | clean: | ||
59 | @rm -f $(EXE) $(OA_SHELL_TMP_FILES) *.log | ||
diff --git a/examples/edmabw/bandwidth.c b/examples/edmabw/bandwidth.c deleted file mode 100644 index 85eaa1a..0000000 --- a/examples/edmabw/bandwidth.c +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * Copyright (c) 2013-2014, Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of Texas Instruments Incorporated nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
26 | * THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | *****************************************************************************/ | ||
28 | #include "edmamgr.h" | ||
29 | #include "omp.h" | ||
30 | |||
31 | float dsp_speed() | ||
32 | { | ||
33 | const unsigned DSP_PLL = 122880000; | ||
34 | char *BOOTCFG_BASE_ADDR = (char*)0x02620000; | ||
35 | char *CLOCK_BASE_ADDR = (char*)0x02310000; | ||
36 | int MAINPLLCTL0 = (*(int*)(BOOTCFG_BASE_ADDR + 0x350)); | ||
37 | int MULT = (*(int*)(CLOCK_BASE_ADDR + 0x110)); | ||
38 | int OUTDIV = (*(int*)(CLOCK_BASE_ADDR + 0x108)); | ||
39 | |||
40 | unsigned mult = 1 + ((MULT & 0x3F) | ((MAINPLLCTL0 & 0x7F000) >> 6)); | ||
41 | unsigned prediv = 1 + (MAINPLLCTL0 & 0x3F); | ||
42 | unsigned output_div = 1 + ((OUTDIV >> 19) & 0xF); | ||
43 | unsigned speed = DSP_PLL * mult / prediv / output_div; | ||
44 | return speed / 1e6; | ||
45 | } | ||
46 | |||
47 | float bandwidth(char *dst, char *src, int size) | ||
48 | { | ||
49 | EdmaMgr_Handle chan = EdmaMgr_alloc(1); | ||
50 | |||
51 | int64_t t0 = __clock64(); | ||
52 | EdmaMgr_copy1D1D(chan, src, dst, size); | ||
53 | EdmaMgr_wait(chan); | ||
54 | int64_t t1 = __clock64(); | ||
55 | |||
56 | EdmaMgr_free(chan); | ||
57 | |||
58 | /*------------------------------------------------------------------------- | ||
59 | * return GB/s | ||
60 | *------------------------------------------------------------------------*/ | ||
61 | return ((float)size/1e9) / ((t1-t0)/(dsp_speed()*1e6)); | ||
62 | } | ||
diff --git a/examples/edmabw/edmabw_host.cpp b/examples/edmabw/edmabw_host.cpp deleted file mode 100644 index 930f9b8..0000000 --- a/examples/edmabw/edmabw_host.cpp +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * Copyright (c) 2013-2014, Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of Texas Instruments Incorporated nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
26 | * THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | *****************************************************************************/ | ||
28 | extern "C"{ | ||
29 | #include "edmamgr.h" | ||
30 | } | ||
31 | |||
32 | /* | ||
33 | * NOTE: | ||
34 | * The OpenMP 4.0 Specification provides a means to check a condition | ||
35 | * based on which a target region may be offloaded to an accelerator | ||
36 | * or run on the host. This functionality is provided by the 'if' | ||
37 | * clause used with #pragma omp target. In order for that scenario | ||
38 | * to work these functions are meant to reflect a host version of | ||
39 | * the EdmaMgr functions used within the OpenMP target region. | ||
40 | * Implementation for these functions are not provided but they may be | ||
41 | * instantiated with a host side edma library call if required. | ||
42 | */ | ||
43 | EdmaMgr_Handle EdmaMgr_alloc (int32_t max_linked_transfers){} | ||
44 | |||
45 | int32_t EdmaMgr_free (EdmaMgr_Handle h){} | ||
46 | |||
47 | void EdmaMgr_wait (EdmaMgr_Handle h){} | ||
48 | |||
49 | int32_t EdmaMgr_copy1D1D (EdmaMgr_Handle h, | ||
50 | void *__restrict__ src, | ||
51 | void *__restrict__ dst, | ||
52 | int32_t num_bytes){} | ||
53 | |||
54 | int32_t EdmaMgr_copy1D2D (EdmaMgr_Handle h, | ||
55 | void *__restrict__ src, | ||
56 | void *__restrict__ dst, | ||
57 | int32_t num_bytes, | ||
58 | int32_t num_lines, | ||
59 | int32_t pitch){} | ||
60 | |||
61 | int32_t EdmaMgr_copy2D1D (EdmaMgr_Handle h, | ||
62 | void *__restrict__ src, | ||
63 | void *__restrict__ dst, | ||
64 | int32_t num_bytes, | ||
65 | int32_t num_lines, | ||
66 | int32_t pitch){} | ||
67 | |||
68 | int32_t EdmaMgr_copy2D2D (EdmaMgr_Handle h, | ||
69 | void *__restrict__ src, | ||
70 | void *__restrict__ dst, | ||
71 | int32_t num_bytes, | ||
72 | int32_t num_lines, | ||
73 | int32_t pitch){} | ||
74 | |||
75 | int32_t EdmaMgr_copy2D2DSep (EdmaMgr_Handle h, | ||
76 | void *__restrict__ src, | ||
77 | void *__restrict__ dst, | ||
78 | int32_t num_bytes, | ||
79 | int32_t num_lines, | ||
80 | int32_t src_pitch, | ||
81 | int32_t dst_pitch){} | ||
82 | |||
83 | int32_t EdmaMgr_copy1D1DLinked (EdmaMgr_Handle h, | ||
84 | void *__restrict__ src[], | ||
85 | void *__restrict__ dst[], | ||
86 | int32_t num_bytes[], | ||
87 | int32_t num_transfers){} | ||
88 | |||
89 | int32_t EdmaMgr_copy1D2DLinked (EdmaMgr_Handle h, | ||
90 | void *__restrict__ src[], | ||
91 | void *__restrict__ dst[], | ||
92 | int32_t num_bytes[], | ||
93 | int32_t num_lines[], | ||
94 | int32_t pitch[], | ||
95 | int32_t num_transfers){} | ||
96 | |||
97 | int32_t EdmaMgr_copy2D1DLinked (EdmaMgr_Handle h, | ||
98 | void *__restrict__ src[], | ||
99 | void *__restrict__ dst[], | ||
100 | int32_t num_bytes[], | ||
101 | int32_t num_lines[], | ||
102 | int32_t pitch[], | ||
103 | int32_t num_transfers){} | ||
104 | |||
105 | int32_t EdmaMgr_copy2D2DLinked (EdmaMgr_Handle h, | ||
106 | void *__restrict__ src[], | ||
107 | void *__restrict__ dst[], | ||
108 | int32_t num_bytes[], | ||
109 | int32_t num_lines[], | ||
110 | int32_t pitch[], | ||
111 | int32_t num_transfers){} | ||
112 | |||
113 | int32_t EdmaMgr_copy2D2DSepLinked(EdmaMgr_Handle h, | ||
114 | void *__restrict__ src[], | ||
115 | void *__restrict__ dst[], | ||
116 | int32_t num_bytes[], | ||
117 | int32_t num_lines[], | ||
118 | int32_t src_pitch[], | ||
119 | int32_t dst_pitch[], | ||
120 | int32_t num_transfers){} | ||
121 | |||
122 | int32_t EdmaMgr_copyFast (EdmaMgr_Handle h, | ||
123 | void *__restrict__ src, | ||
124 | void *__restrict__ dst){} | ||
125 | |||
126 | int32_t EdmaMgr_copyLinkedFast (EdmaMgr_Handle h, | ||
127 | void *__restrict__ src[], | ||
128 | void *__restrict__ dst[], | ||
129 | int32_t num_transfers){} | ||
diff --git a/examples/edmabw/edmabw_main.cpp b/examples/edmabw/edmabw_main.cpp deleted file mode 100644 index 05cc687..0000000 --- a/examples/edmabw/edmabw_main.cpp +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * Copyright (c) 2013-2014, Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of Texas Instruments Incorporated nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
26 | * THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | *****************************************************************************/ | ||
28 | #include <iostream> | ||
29 | #include <cstdio> | ||
30 | #include "ti_omp_device.h" | ||
31 | |||
32 | typedef struct | ||
33 | { | ||
34 | float dd; | ||
35 | float dm; | ||
36 | float dl; | ||
37 | float md; | ||
38 | float mm; | ||
39 | float ml; | ||
40 | float ld; | ||
41 | float lm; | ||
42 | float ll; | ||
43 | } bandwidth_t; | ||
44 | |||
45 | extern "C" | ||
46 | { | ||
47 | bandwidth_t TestBandwidthOnCore(char *ddr, char *msmc, int size, int core_num); | ||
48 | /* Host stubs */ | ||
49 | float bandwidth(char* src,char* ddr, int size){ return 0;} | ||
50 | } | ||
51 | |||
52 | int main(int argc, char *argv[]) | ||
53 | { | ||
54 | #if 0 | ||
55 | int size = 512 << 10; // 512K | ||
56 | #else | ||
57 | int size = 128 << 10; // 128K | ||
58 | #endif | ||
59 | int device_id = 0; | ||
60 | bandwidth_t results[8]; | ||
61 | char* ddr_buf = (char*)__malloc_ddr(size); | ||
62 | char* msmc_buf = (char*)__malloc_msmc(size); | ||
63 | |||
64 | for (int i = 0; i < 8; i++) | ||
65 | { | ||
66 | results[i] = TestBandwidthOnCore(ddr_buf, msmc_buf, size, i); | ||
67 | } | ||
68 | |||
69 | printf("Single channel EDMA bandwidth measured in GB/s\n"); | ||
70 | printf("==============\n"); | ||
71 | printf("From DSP Core:\t"); | ||
72 | for (int i = 0; i < 8; i++) printf("%d\t", i); | ||
73 | printf("\n"); | ||
74 | printf("==============\n"); | ||
75 | |||
76 | printf("ddr => ddr :\t"); | ||
77 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].dd); | ||
78 | printf("\n"); | ||
79 | |||
80 | printf("ddr => msmc :\t"); | ||
81 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].dm); | ||
82 | printf("\n"); | ||
83 | |||
84 | printf("ddr => l2 :\t"); | ||
85 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].dl); | ||
86 | printf("\n"); | ||
87 | |||
88 | printf("msmc => ddr :\t"); | ||
89 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].md); | ||
90 | printf("\n"); | ||
91 | |||
92 | printf("msmc => msmc :\t"); | ||
93 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].mm); | ||
94 | printf("\n"); | ||
95 | |||
96 | printf("msmc => l2 :\t"); | ||
97 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].ml); | ||
98 | printf("\n"); | ||
99 | |||
100 | printf("l2 => ddr :\t"); | ||
101 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].ld); | ||
102 | printf("\n"); | ||
103 | |||
104 | printf("l2 => msmc :\t"); | ||
105 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].lm); | ||
106 | printf("\n"); | ||
107 | |||
108 | printf("l2 => l2 :\t"); | ||
109 | for (int i = 0; i < 8; i++) printf("%.3f\t", results[i].ll); | ||
110 | printf("\n"); | ||
111 | |||
112 | __free_ddr(ddr_buf); | ||
113 | __free_msmc(msmc_buf); | ||
114 | } | ||
diff --git a/examples/edmabw/edmabw_target.c b/examples/edmabw/edmabw_target.c deleted file mode 100644 index 7590fc6..0000000 --- a/examples/edmabw/edmabw_target.c +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * Copyright (c) 2013-2014, Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of Texas Instruments Incorporated nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
26 | * THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | *****************************************************************************/ | ||
28 | #pragma omp declare target | ||
29 | #include <stdio.h> | ||
30 | #include <stdint.h> | ||
31 | #include <omp.h> | ||
32 | uint32_t __core_num(void); | ||
33 | float bandwidth(char*,char*,int); | ||
34 | typedef struct | ||
35 | { | ||
36 | float dd; | ||
37 | float dm; | ||
38 | float dl; | ||
39 | float md; | ||
40 | float mm; | ||
41 | float ml; | ||
42 | float ld; | ||
43 | float lm; | ||
44 | float ll; | ||
45 | } bandwidth_t; | ||
46 | #pragma omp end declare target | ||
47 | |||
48 | bandwidth_t TestBandwidthOnCore(char *ddr, char *msmc, int size, int core_num) | ||
49 | { | ||
50 | char* l2 = NULL; | ||
51 | bandwidth_t results = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; | ||
52 | |||
53 | #pragma omp target map(to:ddr[0:size],msmc[0:size], core_num) \ | ||
54 | map(local:l2[0:size]) \ | ||
55 | map(tofrom: results) | ||
56 | { | ||
57 | #pragma omp parallel default(none) shared(ddr,msmc,l2,core_num) | ||
58 | { | ||
59 | if (__core_num() == core_num) | ||
60 | { | ||
61 | int trials = 100; | ||
62 | int i; | ||
63 | |||
64 | float dd = 0; | ||
65 | float dm = 0; | ||
66 | float dl = 0; | ||
67 | float md = 0; | ||
68 | float mm = 0; | ||
69 | float ml = 0; | ||
70 | float ld = 0; | ||
71 | float lm = 0; | ||
72 | float ll = 0; | ||
73 | |||
74 | for(i=0;i<trials;++i) dd += bandwidth((char*)ddr,(char*)ddr,size); | ||
75 | for(i=0;i<trials;++i) dm += bandwidth((char*)ddr,(char*)msmc,size); | ||
76 | for(i=0;i<trials;++i) dl += bandwidth((char*)ddr,(char*)l2,size); | ||
77 | for(i=0;i<trials;++i) md += bandwidth((char*)msmc,(char*)ddr,size); | ||
78 | for(i=0;i<trials;++i) mm += bandwidth((char*)msmc,(char*)msmc,size); | ||
79 | for(i=0;i<trials;++i) ml += bandwidth((char*)msmc,(char*)l2,size); | ||
80 | for(i=0;i<trials;++i) ld += bandwidth((char*)l2,(char*)ddr,size); | ||
81 | for(i=0;i<trials;++i) lm += bandwidth((char*)l2,(char*)msmc,size); | ||
82 | for(i=0;i<trials;++i) ll += bandwidth((char*)l2,(char*)l2,size); | ||
83 | |||
84 | results.dd = dd/trials; | ||
85 | results.dm = dm/trials; | ||
86 | results.dl = dl/trials; | ||
87 | results.md = md/trials; | ||
88 | results.mm = mm/trials; | ||
89 | results.ml = ml/trials; | ||
90 | results.ld = ld/trials; | ||
91 | results.lm = lm/trials; | ||
92 | results.ll = ll/trials; | ||
93 | } | ||
94 | } | ||
95 | } | ||
96 | |||
97 | return results; | ||
98 | } | ||
diff --git a/examples/edmabw/edmamgr.h b/examples/edmabw/edmamgr.h deleted file mode 100644 index 59e29d4..0000000 --- a/examples/edmabw/edmamgr.h +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * Copyright (c) 2013-2014, Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of Texas Instruments Incorporated nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
26 | * THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | *****************************************************************************/ | ||
28 | #ifndef _EDMAMGR_H | ||
29 | #define _EDMAMGR_H | ||
30 | |||
31 | #include <stdint.h> | ||
32 | |||
33 | typedef void *EdmaMgr_Handle; | ||
34 | |||
35 | EdmaMgr_Handle EdmaMgr_alloc (int32_t max_linked_transfers); | ||
36 | |||
37 | int32_t EdmaMgr_free (EdmaMgr_Handle h); | ||
38 | |||
39 | void EdmaMgr_wait (EdmaMgr_Handle h); | ||
40 | |||
41 | int32_t EdmaMgr_copy1D1D (EdmaMgr_Handle h, | ||
42 | void *__restrict__ src, | ||
43 | void *__restrict__ dst, | ||
44 | int32_t num_bytes); | ||
45 | |||
46 | int32_t EdmaMgr_copy1D2D (EdmaMgr_Handle h, | ||
47 | void *__restrict__ src, | ||
48 | void *__restrict__ dst, | ||
49 | int32_t num_bytes, | ||
50 | int32_t num_lines, | ||
51 | int32_t pitch); | ||
52 | |||
53 | int32_t EdmaMgr_copy2D1D (EdmaMgr_Handle h, | ||
54 | void *__restrict__ src, | ||
55 | void *__restrict__ dst, | ||
56 | int32_t num_bytes, | ||
57 | int32_t num_lines, | ||
58 | int32_t pitch); | ||
59 | |||
60 | int32_t EdmaMgr_copy2D2D (EdmaMgr_Handle h, | ||
61 | void *__restrict__ src, | ||
62 | void *__restrict__ dst, | ||
63 | int32_t num_bytes, | ||
64 | int32_t num_lines, | ||
65 | int32_t pitch); | ||
66 | |||
67 | int32_t EdmaMgr_copy2D2DSep (EdmaMgr_Handle h, | ||
68 | void *__restrict__ src, | ||
69 | void *__restrict__ dst, | ||
70 | int32_t num_bytes, | ||
71 | int32_t num_lines, | ||
72 | int32_t src_pitch, | ||
73 | int32_t dst_pitch); | ||
74 | |||
75 | int32_t EdmaMgr_copy1D1DLinked (EdmaMgr_Handle h, | ||
76 | void *__restrict__ src[], | ||
77 | void *__restrict__ dst[], | ||
78 | int32_t num_bytes[], | ||
79 | int32_t num_transfers); | ||
80 | |||
81 | int32_t EdmaMgr_copy1D2DLinked (EdmaMgr_Handle h, | ||
82 | void *__restrict__ src[], | ||
83 | void *__restrict__ dst[], | ||
84 | int32_t num_bytes[], | ||
85 | int32_t num_lines[], | ||
86 | int32_t pitch[], | ||
87 | int32_t num_transfers); | ||
88 | |||
89 | int32_t EdmaMgr_copy2D1DLinked (EdmaMgr_Handle h, | ||
90 | void *__restrict__ src[], | ||
91 | void *__restrict__ dst[], | ||
92 | int32_t num_bytes[], | ||
93 | int32_t num_lines[], | ||
94 | int32_t pitch[], | ||
95 | int32_t num_transfers); | ||
96 | |||
97 | int32_t EdmaMgr_copy2D2DLinked (EdmaMgr_Handle h, | ||
98 | void *__restrict__ src[], | ||
99 | void *__restrict__ dst[], | ||
100 | int32_t num_bytes[], | ||
101 | int32_t num_lines[], | ||
102 | int32_t pitch[], | ||
103 | int32_t num_transfers); | ||
104 | |||
105 | int32_t EdmaMgr_copy2D2DSepLinked(EdmaMgr_Handle h, | ||
106 | void *__restrict__ src[], | ||
107 | void *__restrict__ dst[], | ||
108 | int32_t num_bytes[], | ||
109 | int32_t num_lines[], | ||
110 | int32_t src_pitch[], | ||
111 | int32_t dst_pitch[], | ||
112 | int32_t num_transfers); | ||
113 | |||
114 | int32_t EdmaMgr_copyFast (EdmaMgr_Handle h, | ||
115 | void *__restrict__ src, | ||
116 | void *__restrict__ dst); | ||
117 | |||
118 | int32_t EdmaMgr_copyLinkedFast (EdmaMgr_Handle h, | ||
119 | void *__restrict__ src[], | ||
120 | void *__restrict__ dst[], | ||
121 | int32_t num_transfers); | ||
122 | |||
123 | #define EdmaMgr_SUCCESS 0 | ||
124 | #define EdmaMgr_ERROR_INVARG -1 | ||
125 | #define EdmaMgr_ERROR_INVCFG -2 | ||
126 | #define EdmaMgr_ERROR_RMANINIT -3 | ||
127 | #define EdmaMgr_ERROR_INVHANDLE -4 | ||
128 | #define EdmaMgr_ERROR_FREE -5 | ||
129 | |||
130 | #endif | ||
diff --git a/host/include/omp.h b/host/include/omp.h index 19f776d..e6065fb 100644 --- a/host/include/omp.h +++ b/host/include/omp.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
diff --git a/host/include/ti_omp_device.h b/host/include/ti_omp_device.h index ee49ac4..5715d12 100644 --- a/host/include/ti_omp_device.h +++ b/host/include/ti_omp_device.h | |||
@@ -29,8 +29,8 @@ | |||
29 | #define _TI_OMP_DEVICE_H_ | 29 | #define _TI_OMP_DEVICE_H_ |
30 | 30 | ||
31 | /*----------------------------------------------------------------------------- | 31 | /*----------------------------------------------------------------------------- |
32 | * While this file may also be included when compiling device code, the | 32 | * While this file may also be included when compiling device code, the |
33 | * following check ensures that these definitions are only included when | 33 | * following check ensures that these definitions are only included when |
34 | * compiling for the host. | 34 | * compiling for the host. |
35 | *----------------------------------------------------------------------------*/ | 35 | *----------------------------------------------------------------------------*/ |
36 | #ifdef __arm__ | 36 | #ifdef __arm__ |
@@ -56,12 +56,12 @@ int omp_get_num_devices (void); | |||
56 | int omp_is_initial_device (void); | 56 | int omp_is_initial_device (void); |
57 | 57 | ||
58 | /*----------------------------------------------------------------------------- | 58 | /*----------------------------------------------------------------------------- |
59 | * This following are definitions for host versions of some functions that are | 59 | * This following are definitions for host versions of some functions that are |
60 | * typically applicable to executions wihin DSP environments. They include | 60 | * typically applicable to executions wihin DSP environments. They include |
61 | * built-in DSP functions as well as functions for cache and dynamic memory | 61 | * built-in DSP functions as well as functions for cache and dynamic memory |
62 | * management. Host versions of these functions are provided to facilitate easy | 62 | * management. Host versions of these functions are provided to facilitate easy |
63 | * compilation and execution of target regions that may end up being executed | 63 | * compilation and execution of target regions that may end up being executed |
64 | * on the host. | 64 | * on the host. |
65 | *----------------------------------------------------------------------------*/ | 65 | *----------------------------------------------------------------------------*/ |
66 | void __touch (const char *p, uint32_t size); | 66 | void __touch (const char *p, uint32_t size); |
67 | uint32_t __core_num (void); | 67 | uint32_t __core_num (void); |
diff --git a/host/version.txt b/host/version.txt index 605ba4c..e7856d0 100644 --- a/host/version.txt +++ b/host/version.txt | |||
@@ -1 +1 @@ | |||
01.05.05.01 | 01.05.06.00 | ||