[graphics][compute]: Simplify hotsort target generation.

This CL simplifies the build rules associated with hotsort
and spinel target generation.

- Modify the hotsort_target() GN template definition to
  pass hotsort_gen configuration parameters through named
  variables (e.g. 'type_dwords', 'thread_regs', etc)
  instead of command-line flags that are more difficult
  to understand. So now, a target declaration looks like:

	hotsort_target("hs_amd_gcn3_u64") {
	  vendor = "amd"
	  type_dwords = 2
	  warp_lanes = 64
	  thread_regs = 8
	  smem_bs = 32768
	  smem_bc = 32768
	  warps_per_group = 16
	  warps_min = 1
	  warps_mod = 1
	  merge_flip_lo = 1
	  merge_flip_hi = 1
	  merge_half_lo = 1
	  merge_half_hi = 1
	  glsl_bindings = "1,0,1,0"
	  autotune = true
	}

  BONUS: This makes gn-format happier than the previous format!

- Each hotsort_target() GN target now provides a public_configs
  value that simplifies client usage. I.e. as long as your
  source_set() depends on a hotsort_target() target, its
  source code can directly include "<target_name>/hs_target.h".

  There is no need to chase the right include_dirs value for
  this include to work.

- Do the same for spinel_target() GN targets.

+ Simplify spinel_vk_context and spinel_vk_path_builder
  accordingly. Note that for now, all targets are still linked
  into the test programs themselves.

TEST: Rebuild with fx build src/graphics/lib/compute:tests

Change-Id: I39992ecff3c8639999eff0171fb897e14e1fcb43
diff --git a/src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_target.gni b/src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_target.gni
index 1ecdde0..3cf42d9 100644
--- a/src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_target.gni
+++ b/src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_target.gni
@@ -7,85 +7,115 @@
 _hotsort_dir = "${graphics_compute_dir}/hotsort"
 
 #
-# Generates a HotSort target by performing the following steps:
+# Generates a "HotSort target", which contains a compiled compute kernel to
+# perform sorting of 32-bit or 64-bit integers, highly optimized for a given
+# GPU architecture.
 #
-#   1. Determine what compute shaders will be generated by the
-#      hotsort_gen executable.
+# To use a hotsort target in your code, do the following:
 #
-#   2. Generate compute shaders and supporting files with the
-#      hotsort_gen executable.
+#   1) Declare a hotsort_target(<target_name>) target in your BUILD.gn
+#      that sets the appropriate configuration parameters (see below).
 #
-#   3. Compile compute shaders to SPIR-V modules.
+#   2) Add <target_name> to your source file's GN target deps variable.
 #
-#   4. Optimize SPIR-V modules.
+#   3) In your source file, #include "<target_name>/hs_target.h", a
+#      special auto-generated header that defines a single variable
+#      declared as:
 #
-#   5. Remap SPIR-V modules.
+#       extern struct hotsort_vk_target const * const <target_name>;
 #
-#   6. Return the target as either:
-#      - a source set
-#      - a binary image produced by the host toolchain
+#      NOTE: This GN template ensures that anything that depends on this
+#            GN target will have the right include_dirs set to do so.
 #
-# If $hotsort_target_name is provided, the generated HotSort target
-# and its artifacts are output to the root of $target_gen_dir.
+#   4) Pass the <target_name> address to hotsort_vk_create().
 #
-# Otherwise, the outputs are found in $target_gen_dir/$target_name.
 #
-# The subdirectories contain the compute shaders and successive stages
-# of processed SPIR-V modules.
+# Variables:
+#
+# The following variable names are optional and used to select various
+# configuration parameters sent to hotsort_gen. Their description comes from
+# comments in the 'hotsort_gen' sources, but should be clarified in the future.
+#
+#    vendor: vendor name. Used to pick the default configuration file from
+#      hotsort/platforms/vk/targets/configs/${vendor}/
+#    type_dwords: number of 32-bit words per sort entry.
+#    warp_lanes: Number of independent ALU cores (CUDA lanes) per
+#       processing element (CUDA warp).
+#    thread_regs: Number of registers to use per thread (lane?).
+#    smem_min: Minimum amount of memory that can be allocated (??)
+#    smem_quantum: smem quantum amount (??)
+#    smem_bs: ??
+#    smem_bc: ??
+#    warps_per_group: Max warps in a workgroup/cta/thread block (??)
+#    warps_max: Max warps that can fit in a multiprocessor (??)
+#    warps_min: blocks using smem barriers must have at least this many warps.
+#    warps_mod: the number of warps necessary to load balance horizontal
+#      merging.
+#    thread_xtra: ??
+#    merge_flip_lo: ??
+#    merge_flip_hi: ??
+#    merge_half_lo: ??
+#    merge_half_hi: ??
+#    merge_flip_warps: ??
+#    merge_half_warps: ??
+#    glsl_bindings: A string containing four comma-separated unsigned integers,
+#      related to GLSL in/out bindings (??)
+#    autotune: Set to true to enable auto-tuning of some parameters (??).
+#
+# The following variables are still supported for legacy reasons.
+#
+#  hotsort_target_name:
+#    A name that conveys the configuration of the generated HotSort
+#    algorithm. If not provided, defaults to the short name of
+#    ${target_name}.
+#
+#  hotsort_target_config_files:
+#    An optional list of additional configuration files, which will be added
+#    to the vendor-specific configuration file determined from the "vendor"
+#    variable (see below).
+#
+#  hotsort_target_dump:
+#    Boolean, if true the generated GN target is a group that references a
+#    target binary produced by the host toolchain.  Otherwise, a source set is
+#    produced on the current toolchain.
+#
+#  hotsort_target_args:
+#    Extra arguments passed to the 'hotsort_gen' HotSort algorithm code
+#    generator.
 #
 template("hotsort_target") {
+  # Order of operations below:
   #
-  # Expects:
+  #   1. Determine what compute shaders will be generated by the
+  #      hotsort_gen executable.
   #
-  #   $hotsort_target_config_files:
+  #   2. Generate compute shaders and supporting files with the
+  #      hotsort_gen executable.
   #
-  #   A list of vendor and arch-specific configuration files.
+  #   3. Compile compute shaders to SPIR-V modules.
   #
-  #   $hotsort_target_name:
+  #   4. Optimize SPIR-V modules.
   #
-  #   A name that conveys the configuration of the generated HotSort
-  #   algorithm. If not provided, defaults to the short name of
-  #   ${target_name}.
+  #   5. Remap SPIR-V modules.
   #
-  #   $hotsort_target_args:
+  #   6. Return the target as either:
+  #      - a source set
+  #      - a binary image produced by the host toolchain
   #
-  #   The arguments passed to the 'hotsort_gen' HotSort algorithm code
-  #   generator.
-  #
-  #   $hotsort_target_dump:
-  #
-  #   If defined the target is group that references a target binary
-  #   produced by the host toolchain.  Otherwise, a source set is
-  #   produced on the current toolchain.
-  #
-  # The hotsort target name and args are passed to 'hotsort_gen' as
-  # follows:
-  #
-  #   'hotsort_gen -D $hotsort_target_name $hotsort_target_args'
-  #
-  # Validation of the args will be performed by 'hotsort_gen'.
-  #
-  # Note that $hotsort_target_name is split from the args list as it
-  # serves a dual role of providing the name of files as well as being
-  # a symbol in the GLSL source and C include files.
-  #
-  assert(defined(invoker.hotsort_target_config_files),
-         "config file list must be defined for hotsort_target")
 
+  # NOTE: If $hotsort_target_name is provided, the generated HotSort target
+  # and its artifacts are output to the root of $target_gen_dir. Otherwise,
+  # the outputs are found in $target_gen_dir/$target_name.
+  #
   if (defined(invoker.hotsort_target_name)) {
     _hs_target_name = invoker.hotsort_target_name
-
-    # Location of all generated files.
     _hs_output_dir = "${target_gen_dir}"
   } else {
     _hs_target_name = get_label_info(target_name, "name")
-
-    # Location of all generated files.
     _hs_output_dir = "${target_gen_dir}/${_hs_target_name}"
   }
 
-  assert(defined(invoker.hotsort_target_args),
-         "args must be defined for hotsort_target")
+  _hs_public_include_dirs = target_gen_dir
 
   #
   # Either dump a binary or produce a source set
@@ -97,9 +127,144 @@
   # prefix target args with implicit args
   #
   _hs_target_gen_args = [
-                          "-o",
-                          rebase_path(_hs_output_dir, root_build_dir),
-                        ] + invoker.hotsort_target_args
+    # Select glsl platform (what hotsort_gen calls an 'arch').
+    "-a",
+    "glsl",
+
+    # hotsort_gen output directory.
+    "-o",
+    rebase_path(_hs_output_dir, root_build_dir),
+  ]
+
+  # Generate the hotsort_gen command line arguments from our GN variables.
+
+  _gen_args = []
+  if (defined(invoker.type_dwords)) {
+    _gen_args += [
+      "-t",
+      "${invoker.type_dwords}",
+    ]
+  }
+  if (defined(invoker.warp_lanes)) {
+    _gen_args += [
+      "-w",
+      "${invoker.warp_lanes}",
+    ]
+  }
+  if (defined(invoker.thread_regs)) {
+    _gen_args += [
+      "-r",
+      "${invoker.thread_regs}",
+    ]
+  }
+  if (defined(invoker.smem_min)) {
+    _gen_args += [
+      "-g",
+      "${invoker.smem_min}",
+    ]
+  }
+  if (defined(invoker.smem_quantum)) {
+    _gen_args += [
+      "-G",
+      "${invoker.smem_quantum}",
+    ]
+  }
+  if (defined(invoker.smem_bs)) {
+    _gen_args += [
+      "-s",
+      "${invoker.smem_bs}",
+    ]
+  }
+  if (defined(invoker.smem_bc)) {
+    _gen_args += [
+      "-S",
+      "${invoker.smem_bc}",
+    ]
+  }
+  if (defined(invoker.warps_per_group)) {
+    _gen_args += [
+      "-b",
+      "${invoker.warps_per_group}",
+    ]
+  }
+  if (defined(invoker.warps_max)) {
+    _gen_args += [
+      "-B",
+      "${invoker.warps_max}",
+    ]
+  }
+  if (defined(invoker.warps_min)) {
+    _gen_args += [
+      "-m",
+      "${invoker.warps_min}",
+    ]
+  }
+  if (defined(invoker.warps_mod)) {
+    _gen_args += [
+      "-M",
+      "${invoker.warps_mod}",
+    ]
+  }
+  if (defined(invoker.thread_xtra)) {
+    _gen_args += [
+      "-x",
+      "${invoker.thread_xtra}",
+    ]
+  }
+  if (defined(invoker.merge_flip_lo)) {
+    _gen_args += [
+      "-f",
+      "${invoker.merge_flip_lo}",
+    ]
+  }
+  if (defined(invoker.merge_flip_hi)) {
+    _gen_args += [
+      "-F",
+      "${invoker.merge_flip_hi}",
+    ]
+  }
+  if (defined(invoker.merge_half_lo)) {
+    _gen_args += [
+      "-c",
+      "${invoker.merge_half_lo}",
+    ]
+  }
+  if (defined(invoker.merge_half_hi)) {
+    _gen_args += [
+      "-C",
+      "${invoker.merge_half_hi}",
+    ]
+  }
+  if (defined(invoker.merge_flip_warps)) {
+    _gen_args += [
+      "-p",
+      "${invoker.merge_flip_warps}",
+    ]
+  }
+  if (defined(invoker.merge_half_warps)) {
+    _gen_args += [
+      "-P",
+      "${invoker.merge_half_warps}",
+    ]
+  }
+  if (defined(invoker.glsl_bindings)) {
+    # NOTE: Parameter is a string
+    _gen_args += [
+      "-L",
+      invoker.glsl_bindings,
+    ]
+  }
+  if (defined(invoker.autotune) && invoker.autotune) {
+    # NOTE: Parameter is a boolean
+    _gen_args += [ "-z" ]
+  }
+
+  _hs_target_gen_args += _gen_args
+
+  # Legacy support
+  if (defined(invoker.hotsort_target_args)) {
+    _hs_target_gen_args += invoker.hotsort_target_args
+  }
 
   #
   # define generated sources, includes and deps
@@ -156,9 +321,15 @@
   #
   # copy any configuration files to the target directory
   #
+  _gen_config_dir =
+      "${_hotsort_dir}/platforms/vk/targets/configs/${invoker.vendor}"
+  _gen_config_files = [ "${_gen_config_dir}/hs_glsl_macros_config.h" ]
+  if (defined(invoker.hotsort_target_config_files)) {
+    _gen_config_files += invoker.hotsort_target_config_files
+  }
   _gen_copy_target_name = "gen_copy_${_hs_target_name}"
   copy(_gen_copy_target_name) {
-    sources = invoker.hotsort_target_config_files
+    sources = _gen_config_files
     outputs = [
       "${_hs_output_dir}/{{source_file_part}}",
     ]
@@ -251,12 +422,18 @@
     #
     # target is a source set
     #
+    _config_name = "${target_name}_public_config"
+    config(_config_name) {
+      include_dirs = [ _hs_public_include_dirs ]
+    }
+
     source_set(target_name) {
       public = [
         "${_hs_output_dir}/hs_target.h",
       ]
       sources = _hs_target_sources
       include_dirs = _hs_target_include_dirs
+      public_configs = [ ":${_config_name}" ]
       deps = [
         ":${_gen_comp_target_name}",
         ":${_gen_modules_target_name}",
diff --git a/src/graphics/lib/compute/hotsort/platforms/vk/tests/hotsort_vk_bench/BUILD.gn b/src/graphics/lib/compute/hotsort/platforms/vk/tests/hotsort_vk_bench/BUILD.gn
index 2161f07..c09b0b9 100644
--- a/src/graphics/lib/compute/hotsort/platforms/vk/tests/hotsort_vk_bench/BUILD.gn
+++ b/src/graphics/lib/compute/hotsort/platforms/vk/tests/hotsort_vk_bench/BUILD.gn
@@ -6,22 +6,6 @@
 import("../../targets/hotsort_target.gni")
 
 #
-# Generate and build several HotSort targets.
-# See exact definitions below.
-#
-
-group("targets") {
-  public_deps = [
-    ":hs_amd_gcn3_u32",
-    ":hs_amd_gcn3_u64",
-    ":hs_intel_gen8_u32",
-    ":hs_intel_gen8_u64",
-    ":hs_nvidia_sm35_u32",
-    ":hs_nvidia_sm35_u64",
-  ]
-}
-
-#
 # hotsort_vk_bench: benchmark HotSort
 #
 
@@ -30,17 +14,19 @@
     "main.c",
     "sort.cpp",
   ]
-  include_dirs = [ "$target_gen_dir" ]
   deps = [
-    ":targets",
+    ":hs_amd_gcn3_u32",
+    ":hs_amd_gcn3_u64",
+    ":hs_intel_gen8_u32",
+    ":hs_intel_gen8_u64",
+    ":hs_nvidia_sm35_u32",
+    ":hs_nvidia_sm35_u64",
     "${graphics_compute_dir}/common",
     "${graphics_compute_dir}/common/vk",
     "${graphics_compute_dir}/hotsort/platforms/vk",
   ]
 }
 
-_hotsort_targets_dir = "${graphics_compute_dir}/hotsort/platforms/vk/targets"
-
 #
 # configuration
 #
@@ -48,26 +34,21 @@
 #
 
 hotsort_target("hs_amd_gcn3_u32") {
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/amd/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "1",
-    "-w", "64",
-    "-r", "16",
-    "-s", "32768",
-    "-S", "32768",
-    "-b", "16",
-    "-m", "1",
-    "-M", "1",
-    "-f", "1",
-    "-F", "1",
-    "-c", "1",
-    "-C", "1",
-    "-L", "0,1,0,0",
-    "-z",
-  ]
+  vendor = "amd"
+  type_dwords = 1
+  warp_lanes = 64
+  thread_regs = 16
+  smem_bs = 32768
+  smem_bc = 32768
+  warps_per_group = 16
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_lo = 1
+  merge_flip_hi = 1
+  merge_half_lo = 1
+  merge_half_hi = 1
+  glsl_bindings = "0,1,0,0"
+  autotune = true
 }
 
 #
@@ -77,26 +58,21 @@
 #
 
 hotsort_target("hs_amd_gcn3_u64") {
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/amd/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "2",
-    "-w", "64",
-    "-r", "8",
-    "-s", "32768",
-    "-S", "32768",
-    "-b", "16",
-    "-m", "1",
-    "-M", "1",
-    "-f", "1",
-    "-F", "1",
-    "-c", "1",
-    "-C", "1",
-    "-L", "0,1,0,0",
-    "-z",
-  ]
+  vendor = "amd"
+  type_dwords = 2
+  warp_lanes = 64
+  thread_regs = 8
+  smem_bs = 32768
+  smem_bc = 32768
+  warps_per_group = 16
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_lo = 1
+  merge_flip_hi = 1
+  merge_half_lo = 1
+  merge_half_hi = 1
+  glsl_bindings = "0,1,0,0"
+  autotune = true
 }
 
 #
@@ -106,27 +82,22 @@
 #
 
 hotsort_target("hs_intel_gen8_u32") {
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/intel/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "1",
-    "-w", "16",
-    "-r", "8",
-    "-s", "21504",
-    "-S", "65536",
-    "-b", "16",
-    "-B", "48",
-    "-m", "1",
-    "-M", "1",
-    "-f", "0",
-    "-F", "0",
-    "-c", "0",
-    "-C", "0",
-    "-L", "0,1,0,0",
-    "-z",
-  ]
+  vendor = "intel"
+  type_dwords = 1
+  warp_lanes = 8
+  thread_regs = 8
+  smem_bs = 21504
+  smem_bc = 65536
+  warps_per_group = 16
+  warps_max = 48
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_lo = 0
+  merge_flip_hi = 0
+  merge_half_lo = 0
+  merge_half_hi = 0
+  glsl_bindings = "0,1,0,0"
+  autotune = true
 }
 
 #
@@ -136,27 +107,22 @@
 #
 
 hotsort_target("hs_intel_gen8_u64") {
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/intel/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "2",
-    "-w", "8",
-    "-r", "16",
-    "-s", "21504",
-    "-S", "65536",
-    "-b", "16",
-    "-B", "48",
-    "-m", "1",
-    "-M", "1",
-    "-f", "1",
-    "-F", "1",
-    "-c", "1",
-    "-C", "1",
-    "-L", "0,1,0,0",
-    "-z",
-  ]
+  vendor = "intel"
+  type_dwords = 2
+  warp_lanes = 8
+  thread_regs = 16
+  smem_bs = 21504
+  smem_bc = 65536
+  warps_per_group = 16
+  warps_max = 48
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_lo = 1
+  merge_flip_hi = 1
+  merge_half_lo = 1
+  merge_half_hi = 1
+  glsl_bindings = "0,1,0,0"
+  autotune = true
 }
 
 #
@@ -167,28 +133,23 @@
 #
 
 hotsort_target("hs_nvidia_sm35_u32") {
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/nvidia/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "1",
-    "-w", "32",
-    "-r", "16",
-    "-s", "32768",
-    "-S", "32768",
-    "-b", "16",
-    "-m", "1",
-    "-M", "1",
-    "-p", "1",
-    "-P", "1",
-    "-f", "0",
-    "-F", "0",
-    "-c", "0",
-    "-C", "0",
-    "-L", "0,1,0,0",
-    "-z",
-  ]
+  vendor = "nvidia"
+  type_dwords = 1
+  warp_lanes = 32
+  thread_regs = 16
+  smem_bs = 32768
+  smem_bc = 32768
+  warps_per_group = 16
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_warps = 1
+  merge_half_warps = 1
+  merge_flip_lo = 0
+  merge_flip_hi = 0
+  merge_half_lo = 0
+  merge_half_hi = 0
+  glsl_bindings = "0,1,0,0"
+  autotune = true
 }
 
 #
@@ -199,26 +160,21 @@
 #
 
 hotsort_target("hs_nvidia_sm35_u64") {
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/nvidia/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "2",
-    "-w", "32",
-    "-r", "8",
-    "-s", "32768",
-    "-S", "32768",
-    "-b", "16",
-    "-m", "1",
-    "-M", "1",
-    "-p", "1",
-    "-P", "1",
-    "-f", "0",
-    "-F", "0",
-    "-c", "0",
-    "-C", "0",
-    "-L", "0,1,0,0",
-    "-z",
-  ]
+  vendor = "nvidia"
+  type_dwords = 2
+  warp_lanes = 32
+  thread_regs = 8
+  smem_bs = 32768
+  smem_bc = 32768
+  warps_per_group = 16
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_warps = 1
+  merge_half_warps = 1
+  merge_flip_lo = 0
+  merge_flip_hi = 0
+  merge_half_lo = 0
+  merge_half_hi = 0
+  glsl_bindings = "0,1,0,0"
+  autotune = true
 }
diff --git a/src/graphics/lib/compute/spinel/platforms/vk/targets/spinel_target.gni b/src/graphics/lib/compute/spinel/platforms/vk/targets/spinel_target.gni
index ec4214d..d15b0f8 100644
--- a/src/graphics/lib/compute/spinel/platforms/vk/targets/spinel_target.gni
+++ b/src/graphics/lib/compute/spinel/platforms/vk/targets/spinel_target.gni
@@ -61,7 +61,7 @@
   _spn_target_dir = get_path_info(invoker.spinel_target_config, "dir")
 
   _spn_target_includes_public = [ _spn_target_dir + "/spn_target.h" ]
-
+  _spn_target_gen_includes_dir = target_gen_dir
   _spn_target_gen_includes = [ "$target_gen_dir/spn_modules.inl" ]
 
   _spn_target_includes = [
@@ -204,6 +204,10 @@
     #
     # target is a source set
     #
+    _config_name = "${target_name}_public_config"
+    config(_config_name) {
+      include_dirs = [ _spn_target_gen_includes_dir ]
+    }
     source_set(target_name) {
       public = _spn_target_includes_public
       sources = _spn_target_sources
@@ -214,6 +218,7 @@
       public_deps = [
         ":gen_modules",
       ]
+      public_configs = [ ":${_config_name}" ]
       if (defined(invoker.public_deps)) {
         public_deps += invoker.public_deps
       }
diff --git a/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/amd/gcn3/hotsort/BUILD.gn b/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/amd/gcn3/hotsort/BUILD.gn
index e0fbb28..8c94b4f 100644
--- a/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/amd/gcn3/hotsort/BUILD.gn
+++ b/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/amd/gcn3/hotsort/BUILD.gn
@@ -13,24 +13,19 @@
 
 hotsort_target("hotsort") {
   hotsort_target_name = "hs_amd_gcn3_u64"
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/amd/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "2",
-    "-w", "64",
-    "-r", "8",
-    "-s", "32768",
-    "-S", "32768",
-    "-b", "16",
-    "-m", "1",
-    "-M", "1",
-    "-f", "1",
-    "-F", "1",
-    "-c", "1",
-    "-C", "1",
-    "-L", "1,0,1,0",
-    "-z",
-  ]
+  vendor = "amd"
+  type_dwords = 2
+  warp_lanes = 64
+  thread_regs = 8
+  smem_bs = 32768
+  smem_bc = 32768
+  warps_per_group = 16
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_lo = 1
+  merge_flip_hi = 1
+  merge_half_lo = 1
+  merge_half_hi = 1
+  glsl_bindings = "1,0,1,0"
+  autotune = true
 }
diff --git a/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/intel/gen8/hotsort/BUILD.gn b/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/intel/gen8/hotsort/BUILD.gn
index c2464c4..d50b3c1 100644
--- a/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/intel/gen8/hotsort/BUILD.gn
+++ b/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/intel/gen8/hotsort/BUILD.gn
@@ -13,25 +13,20 @@
 
 hotsort_target("hotsort") {
   hotsort_target_name = "hs_intel_gen8_u64"
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/intel/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a", "glsl",
-    "-t", "2",
-    "-w", "8",
-    "-r", "16",
-    "-s", "21504",
-    "-S", "65536",
-    "-b", "16",
-    "-B", "48",
-    "-m", "1",
-    "-M", "1",
-    "-f", "1",
-    "-F", "1",
-    "-c", "1",
-    "-C", "1",
-    "-L", "1,0,1,0",
-    "-z",
-  ]
+  vendor = "intel"
+  type_dwords = 2
+  warp_lanes = 8
+  thread_regs = 16
+  smem_bs = 21504
+  smem_bc = 65536
+  warps_per_group = 16
+  warps_max = 48
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_lo = 1
+  merge_flip_hi = 1
+  merge_half_lo = 1
+  merge_half_hi = 1
+  glsl_bindings = "1,0,1,0"
+  autotune = true
 }
diff --git a/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/nvidia/sm50/hotsort/BUILD.gn b/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/nvidia/sm50/hotsort/BUILD.gn
index f491c44..14cf6ae 100644
--- a/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/nvidia/sm50/hotsort/BUILD.gn
+++ b/src/graphics/lib/compute/spinel/platforms/vk/targets/vendors/nvidia/sm50/hotsort/BUILD.gn
@@ -14,26 +14,21 @@
 
 hotsort_target("hotsort") {
   hotsort_target_name = "hs_nvidia_sm35_u64"
-  hotsort_target_config_files =
-      [ "${_hotsort_targets_dir}/configs/nvidia/hs_glsl_macros_config.h" ]
-  hotsort_target_args = [
-    # "-v",
-    "-a" , "glsl",
-    "-t" , "2",
-    "-w" , "32",
-    "-r" , "8",
-    "-s" , "32768",
-    "-S" , "32768",
-    "-b" , "16",
-    "-m" , "1",
-    "-M" , "1",
-    "-p" , "1",
-    "-P" , "1",
-    "-f" , "0",
-    "-F" , "0",
-    "-c" , "0",
-    "-C" , "0",
-    "-L" , "1,0,1,0",
-    "-z"
-  ]
+  vendor = "nvidia"
+  type_dwords = 2
+  warp_lanes = 32
+  thread_regs = 8
+  smem_bs = 32768
+  smem_bc = 32768
+  warps_per_group = 16
+  warps_min = 1
+  warps_mod = 1
+  merge_flip_warps = 1
+  merge_half_warps = 1
+  merge_flip_lo = 0
+  merge_flip_hi = 0
+  merge_half_lo = 0
+  merge_half_hi = 0
+  glsl_bindings = "1,0,1,0"
+  autotune = true
 }
diff --git a/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_context/BUILD.gn b/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_context/BUILD.gn
index a9b34ae..7f7255b 100644
--- a/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_context/BUILD.gn
+++ b/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_context/BUILD.gn
@@ -14,25 +14,11 @@
   include_dirs =
       [ "$root_gen_dir/src/graphics/lib/compute/spinel/platforms/vk" ]
   deps = [
-    ":targets",
     "${graphics_compute_dir}/common",
     "${graphics_compute_dir}/common/vk",
-    "${graphics_compute_dir}/common/vk",
-    "${graphics_compute_dir}/hotsort/platforms/vk",
     "${graphics_compute_dir}/spinel/platforms/vk",
-  ]
-}
-
-#
-# generate and build Spinel targets
-#
-group("targets") {
-  public_deps = [
     "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/amd/gcn3:generate",
-    "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/amd/gcn3/hotsort",
     "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/intel/gen8:generate",
-    "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/intel/gen8/hotsort",
     "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/nvidia/sm50:generate",
-    "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/nvidia/sm50/hotsort",
   ]
 }
diff --git a/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_path_builder/BUILD.gn b/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_path_builder/BUILD.gn
index 64fb030..f6f0b5a 100644
--- a/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_path_builder/BUILD.gn
+++ b/src/graphics/lib/compute/spinel/platforms/vk/tests/spinel_vk_path_builder/BUILD.gn
@@ -14,24 +14,11 @@
   include_dirs =
       [ "$root_gen_dir/src/graphics/lib/compute/spinel/platforms/vk" ]
   deps = [
-    ":targets",
     "${graphics_compute_dir}/common",
     "${graphics_compute_dir}/common/vk",
-    "${graphics_compute_dir}/hotsort/platforms/vk",
     "${graphics_compute_dir}/spinel/platforms/vk",
-  ]
-}
-
-#
-# generate and build Spinel targets
-#
-group("targets") {
-  public_deps = [
     "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/amd/gcn3:generate",
-    "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/amd/gcn3/hotsort",
     "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/intel/gen8:generate",
-    "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/intel/gen8/hotsort",
     "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/nvidia/sm50:generate",
-    "${graphics_compute_dir}/spinel/platforms/vk/targets/vendors/nvidia/sm50/hotsort",
   ]
 }