Skip to content

Instantly share code, notes, and snippets.

View navyxliu's full-sized avatar
🍉
watermelon

xin liu navyxliu

🍉
watermelon
  • Amazon.com
  • Seattle
View GitHub Profile
#include <amptest.h>
#include <amptest_main.h>
using std::vector;
using namespace Concurrency;
using namespace Concurrency::Test;
bool Equal(float in1, float in2) __GPU
{
return amptest_math::are_almost_equal(in1, in2);
//adapted from bug011
#include <amp.h>
using namespace Concurrency;
int test() restrict(amp)
{
int data0[] = {1, 2, 3, 4};
extent<4> e4(data0);
#include <amp.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
using namespace Concurrency;
template <typename _type>
int test_debug() __GPU {
const int rank = _type::rank;
int data1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
#include <amptest.h>
#include <amptest_main.h>
#include <vector>
using std::vector;
using namespace Concurrency;
using namespace Concurrency::Test;
/// Common Section
@navyxliu
navyxliu / gist:2d3662df2a0f89d82207
Created July 7, 2015 09:52
tiling parallel_for_each
#include <amp.h>
#include <vector>
#include <stdlib.h>
using namespace Concurrency;
using namespace std;
const static int DOMAIN_SIZE = 2048;
const static int BLOCK_SIZE = 16;
void foo() {
Concurrency::extent<1> g(DOMAIN_SIZE);
@navyxliu
navyxliu / gist:e02ed95819dd4a91c33e
Created July 11, 2015 02:12
pass object pointer
#include <amp.h>
#include <vector>
#include <stdlib.h>
using namespace concurrency;
using namespace std;
const static int DOMAIN_SIZE = 1024;
const static int BLOCK_SIZE = 16;
typedef int TY;
template<typename type, int rank>
@navyxliu
navyxliu / t5.cpp
Created July 25, 2015 17:02
broken case
#include <amp.h>
#include <vector>
#include <stdlib.h>
using namespace concurrency;
using namespace std;
const static int DOMAIN_SIZE = 1024;
const static int BLOCK_SIZE = 16;
typedef int TY;
template<typename type, int rank>
SetupNativeCompilation(BUILD_TEST_ProcessUtils)
[2] LIBRARY := ProcessUtils
[3] EXTRA_FILES := /src/hotspot/test/vmTestbase/vm/share/libProcessUtils.cpp
[4] OUTPUT_DIR := /build/support/test/hotspot/jtreg/native/lib
[5] OBJECT_DIR := /build/support/test/hotspot/jtreg/native/support/libProcessUtils
[6] LANG := C++
[7] CFLAGS := -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -fno-omit-frame-pointer -D_LP64=1 -D_LITTLE_ENDIAN -DLINUX -DARCH='"amd64"' -Damd64 -DDEBUG -DRELEASE='"1.8.0-internal-fastdebug"' -I/build/jdk/include -I/build/jdk/include/linux -I/src/jdk/src/share/javavm/export -I/src/jdk/src/solaris/javavm/export -I/src/jdk/src/share/native/common -I/src/jdk/src/solaris/native/common -fno-strict-aliasing -g1 -fPIC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/src/hotspot/test/vmTestbase/vm/share -I/src/hotspot/test/vmTestbase/nsk/share/native -I/src/hotspot/test/vmTestba
@navyxliu
navyxliu / gist:0dc4d685eae1026b32f642bf42452eee
Created September 25, 2019 19:46
warning from gcc 4.4.6
## Starting test-image
(cd /src/hotspot/test && /bin/bash /src/common/bin/logger.sh /build/build.log /usr/bin/gmake -s VERBOSE="-s" LOG_LEVEL="warn" -R -I /src/make/common -j1 MAKEFLAGS= SPEC=/build/spec.gmk \
JT_HOME=/opt/jtreg PRODUCT_HOME=/build/images/j2sdk-image ALT_OUTPUTDIR=/build CONCURRENCY=1 \
-f JtregNativeHotspot.gmk build-test-hotspot-jtreg-native)
In file included from /src/hotspot/test/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/libearlyretlong.cpp:33:
/src/hotspot/test/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/earlyretlong.cpp: In function 'void Java_nsk_jvmti_unit_ForceEarlyReturn_earlyretlong_printLong(JNIEnv*, _jclass*, jlong)':
/src/hotspot/test/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/earlyretlong.cpp:414: warning: dereferencing pointer 'iptr' does break strict-aliasing rules
/src/hotspot/test/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/earlyretlong.cpp:411: note: initialized from here
/src/hotspot/test/vmTestbase/nsk/jvmti/unit/Forc
@navyxliu
navyxliu / TestDescription.jtr
Created October 6, 2019 23:23
[jdk8u] vmTestbase/gc/g1/unloading/tests/unloading_anonclassloader_inMemoryCompilation_keep_class/TestDescription.java
#Test Results (version 2)
#Sun Oct 06 23:14:31 UTC 2019
#-----testdescription-----
$file=/src/hotspot/test/vmTestbase/gc/g1/unloading/tests/unloading_anonclassloader_inMemoryCompilation_keep_class/TestDescription.java
$root=/src/hotspot/test
keywords=stress gc othervm driver
library=/vmTestbase /testlibrary /test/lib
modules=java.base/jdk.internal.misc\:+open java.base/jdk.internal.misc
requires=((vm.gc.G1) & (vm.opt.ClassUnloading \!\= false)) & (vm.opt.ClassUnloadingWithConcurrentMark \!\= false)
run=USER_SPECIFIED driver jdk.test.lib.FileInstaller . .\nUSER_SPECIFIED driver gc.g1.unloading.bytecode.GenClassesBuilder\nUSER_SPECIFIED build sun.hotspot.WhiteBox\nUSER_SPECIFIED driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission\nUSER_SPECIFIED main/othervm -Xbootclasspath/a\:. -XX\:+UnlockDiagnosticVMOptions -XX\:+WhiteBoxAPI -XX\:+UseG1GC -XX\:+ExplicitGCInvokesConcurrent -Xloggc\:gc.log -XX\:-UseGCOverheadLimit gc.g1.unloading.UnloadingTest -classloadingMethod anonymous_cl